squad-kit 0.12.4 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +175 -1
- package/README.md +110 -220
- package/dist/cli.js +14874 -1389
- package/dist/console-ui/assets/ibm-plex-sans-arabic-arabic-400-normal-CyU-ddYS.woff2 +0 -0
- package/dist/console-ui/assets/ibm-plex-sans-arabic-arabic-500-normal-C4MQITzh.woff2 +0 -0
- package/dist/console-ui/assets/ibm-plex-sans-arabic-arabic-600-normal-0pRdybE_.woff2 +0 -0
- package/dist/console-ui/assets/ibm-plex-sans-arabic-arabic-700-normal-DrtBj6UE.woff2 +0 -0
- package/dist/console-ui/assets/index-CSk4SKT_.css +1 -0
- package/dist/console-ui/assets/index-DKFsGYQn.js +500 -0
- package/dist/console-ui/assets/instrument-sans-latin-ext-standard-normal-C5E2Gvlv.woff2 +0 -0
- package/dist/console-ui/assets/instrument-sans-latin-standard-normal-BVScPF0l.woff2 +0 -0
- package/dist/console-ui/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
- package/dist/console-ui/assets/jetbrains-mono-cyrillic-500-normal-DmUKJPL_.woff2 +0 -0
- package/dist/console-ui/assets/jetbrains-mono-cyrillic-600-normal-EVf6-Yzo.woff2 +0 -0
- package/dist/console-ui/assets/jetbrains-mono-cyrillic-ext-400-normal-C_uLvvQ5.woff2 +0 -0
- package/dist/console-ui/assets/jetbrains-mono-cyrillic-ext-500-normal-C9ShMxGR.woff2 +0 -0
- package/dist/console-ui/assets/jetbrains-mono-cyrillic-ext-600-normal-Dj6eZy5f.woff2 +0 -0
- package/dist/console-ui/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
- package/dist/console-ui/assets/jetbrains-mono-greek-500-normal-JpySY46c.woff2 +0 -0
- package/dist/console-ui/assets/jetbrains-mono-greek-600-normal-H7WoG9Et.woff2 +0 -0
- package/dist/console-ui/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- package/dist/console-ui/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
- package/dist/console-ui/assets/jetbrains-mono-latin-600-normal-C8RAYTDA.woff2 +0 -0
- package/dist/console-ui/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
- package/dist/console-ui/assets/jetbrains-mono-latin-ext-500-normal-Cut-4mMH.woff2 +0 -0
- package/dist/console-ui/assets/jetbrains-mono-latin-ext-600-normal-BfB_LPfz.woff2 +0 -0
- package/dist/console-ui/assets/jetbrains-mono-vietnamese-400-normal-ByoDsISC.woff2 +0 -0
- package/dist/console-ui/assets/jetbrains-mono-vietnamese-500-normal-BvH7FW2L.woff2 +0 -0
- package/dist/console-ui/assets/jetbrains-mono-vietnamese-600-normal-Dtizs43-.woff2 +0 -0
- package/dist/console-ui/index.html +5 -5
- package/dist/console-ui/logo.svg +8 -17
- package/package.json +5 -3
- package/templates/demo/proof/sk139-after.png +0 -0
- package/templates/demo/proof/sk139-before.png +0 -0
- package/templates/demo/proof/sk148-dark-b.png +0 -0
- package/templates/demo/proof/sk148-dark.png +0 -0
- package/templates/demo/proof/sk148-light.png +0 -0
- package/dist/console-ui/assets/index-DP-vFdYe.css +0 -1
- package/dist/console-ui/assets/index-DzO_eLUH.js +0 -442
|
@@ -1,442 +0,0 @@
|
|
|
1
|
-
function dU(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var ts=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ze(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var LD={exports:{}},jv={},$D={exports:{}},je={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Vd=Symbol.for("react.element"),pU=Symbol.for("react.portal"),mU=Symbol.for("react.fragment"),gU=Symbol.for("react.strict_mode"),yU=Symbol.for("react.profiler"),vU=Symbol.for("react.provider"),bU=Symbol.for("react.context"),xU=Symbol.for("react.forward_ref"),wU=Symbol.for("react.suspense"),SU=Symbol.for("react.memo"),kU=Symbol.for("react.lazy"),dE=Symbol.iterator;function OU(e){return e===null||typeof e!="object"?null:(e=dE&&e[dE]||e["@@iterator"],typeof e=="function"?e:null)}var BD={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},FD=Object.assign,zD={};function kc(e,t,n){this.props=e,this.context=t,this.refs=zD,this.updater=n||BD}kc.prototype.isReactComponent={};kc.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};kc.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function WD(){}WD.prototype=kc.prototype;function FO(e,t,n){this.props=e,this.context=t,this.refs=zD,this.updater=n||BD}var zO=FO.prototype=new WD;zO.constructor=FO;FD(zO,kc.prototype);zO.isPureReactComponent=!0;var pE=Array.isArray,UD=Object.prototype.hasOwnProperty,WO={current:null},HD={key:!0,ref:!0,__self:!0,__source:!0};function VD(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)UD.call(t,r)&&!HD.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];i.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:Vd,type:e,key:o,ref:s,props:i,_owner:WO.current}}function CU(e,t){return{$$typeof:Vd,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function UO(e){return typeof e=="object"&&e!==null&&e.$$typeof===Vd}function AU(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var mE=/\/+/g;function Sb(e,t){return typeof e=="object"&&e!==null&&e.key!=null?AU(""+e.key):t.toString(36)}function Im(e,t,n,r,i){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(o){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Vd:case pU:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+Sb(s,0):r,pE(i)?(n="",e!=null&&(n=e.replace(mE,"$&/")+"/"),Im(i,t,n,"",function(u){return u})):i!=null&&(UO(i)&&(i=CU(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(mE,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",pE(e))for(var a=0;a<e.length;a++){o=e[a];var l=r+Sb(o,a);s+=Im(o,t,n,l,i)}else if(l=OU(e),typeof l=="function")for(e=l.call(e),a=0;!(o=e.next()).done;)o=o.value,l=r+Sb(o,a++),s+=Im(o,t,n,l,i);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function gp(e,t,n){if(e==null)return e;var r=[],i=0;return Im(e,r,"","",function(o){return t.call(n,o,i++)}),r}function PU(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ln={current:null},Nm={transition:null},EU={ReactCurrentDispatcher:Ln,ReactCurrentBatchConfig:Nm,ReactCurrentOwner:WO};function qD(){throw Error("act(...) is not supported in production builds of React.")}je.Children={map:gp,forEach:function(e,t,n){gp(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return gp(e,function(){t++}),t},toArray:function(e){return gp(e,function(t){return t})||[]},only:function(e){if(!UO(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};je.Component=kc;je.Fragment=mU;je.Profiler=yU;je.PureComponent=FO;je.StrictMode=gU;je.Suspense=wU;je.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=EU;je.act=qD;je.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=FD({},e.props),i=e.key,o=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,s=WO.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)UD.call(t,l)&&!HD.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:Vd,type:e.type,key:i,ref:o,props:r,_owner:s}};je.createContext=function(e){return e={$$typeof:bU,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:vU,_context:e},e.Consumer=e};je.createElement=VD;je.createFactory=function(e){var t=VD.bind(null,e);return t.type=e,t};je.createRef=function(){return{current:null}};je.forwardRef=function(e){return{$$typeof:xU,render:e}};je.isValidElement=UO;je.lazy=function(e){return{$$typeof:kU,_payload:{_status:-1,_result:e},_init:PU}};je.memo=function(e,t){return{$$typeof:SU,type:e,compare:t===void 0?null:t}};je.startTransition=function(e){var t=Nm.transition;Nm.transition={};try{e()}finally{Nm.transition=t}};je.unstable_act=qD;je.useCallback=function(e,t){return Ln.current.useCallback(e,t)};je.useContext=function(e){return Ln.current.useContext(e)};je.useDebugValue=function(){};je.useDeferredValue=function(e){return Ln.current.useDeferredValue(e)};je.useEffect=function(e,t){return Ln.current.useEffect(e,t)};je.useId=function(){return Ln.current.useId()};je.useImperativeHandle=function(e,t,n){return Ln.current.useImperativeHandle(e,t,n)};je.useInsertionEffect=function(e,t){return Ln.current.useInsertionEffect(e,t)};je.useLayoutEffect=function(e,t){return Ln.current.useLayoutEffect(e,t)};je.useMemo=function(e,t){return Ln.current.useMemo(e,t)};je.useReducer=function(e,t,n){return Ln.current.useReducer(e,t,n)};je.useRef=function(e){return Ln.current.useRef(e)};je.useState=function(e){return Ln.current.useState(e)};je.useSyncExternalStore=function(e,t,n){return Ln.current.useSyncExternalStore(e,t,n)};je.useTransition=function(){return Ln.current.useTransition()};je.version="18.3.1";$D.exports=je;var C=$D.exports;const L=ze(C),HO=dU({__proto__:null,default:L},[C]);/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var TU=C,_U=Symbol.for("react.element"),jU=Symbol.for("react.fragment"),MU=Object.prototype.hasOwnProperty,IU=TU.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,NU={key:!0,ref:!0,__self:!0,__source:!0};function KD(e,t,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)MU.call(t,r)&&!NU.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:_U,type:e,key:o,ref:s,props:i,_owner:IU.current}}jv.Fragment=jU;jv.jsx=KD;jv.jsxs=KD;LD.exports=jv;var g=LD.exports,GD={exports:{}},Pr={},QD={exports:{}},XD={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t($,z){var T=$.length;$.push(z);e:for(;0<T;){var q=T-1>>>1,I=$[q];if(0<i(I,z))$[q]=z,$[T]=I,T=q;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var z=$[0],T=$.pop();if(T!==z){$[0]=T;e:for(var q=0,I=$.length,_=I>>>1;q<_;){var K=2*(q+1)-1,Q=$[K],te=K+1,he=$[te];if(0>i(Q,T))te<I&&0>i(he,Q)?($[q]=he,$[te]=T,q=te):($[q]=Q,$[K]=T,q=K);else if(te<I&&0>i(he,T))$[q]=he,$[te]=T,q=te;else break e}}return z}function i($,z){var T=$.sortIndex-z.sortIndex;return T!==0?T:$.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],c=1,f=null,h=3,d=!1,p=!1,m=!1,v=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x($){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=$)r(u),z.sortIndex=z.expirationTime,t(l,z);else break;z=n(u)}}function k($){if(m=!1,x($),!p)if(n(l)!==null)p=!0,B(w);else{var z=n(u);z!==null&&F(k,z.startTime-$)}}function w($,z){p=!1,m&&(m=!1,b(A),A=-1),d=!0;var T=h;try{for(x(z),f=n(l);f!==null&&(!(f.expirationTime>z)||$&&!j());){var q=f.callback;if(typeof q=="function"){f.callback=null,h=f.priorityLevel;var I=q(f.expirationTime<=z);z=e.unstable_now(),typeof I=="function"?f.callback=I:f===n(l)&&r(l),x(z)}else r(l);f=n(l)}if(f!==null)var _=!0;else{var K=n(u);K!==null&&F(k,K.startTime-z),_=!1}return _}finally{f=null,h=T,d=!1}}var S=!1,O=null,A=-1,P=5,M=-1;function j(){return!(e.unstable_now()-M<P)}function E(){if(O!==null){var $=e.unstable_now();M=$;var z=!0;try{z=O(!0,$)}finally{z?D():(S=!1,O=null)}}else S=!1}var D;if(typeof y=="function")D=function(){y(E)};else if(typeof MessageChannel<"u"){var R=new MessageChannel,N=R.port2;R.port1.onmessage=E,D=function(){N.postMessage(null)}}else D=function(){v(E,0)};function B($){O=$,S||(S=!0,D())}function F($,z){A=v(function(){$(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function($){$.callback=null},e.unstable_continueExecution=function(){p||d||(p=!0,B(w))},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function($){switch(h){case 1:case 2:case 3:var z=3;break;default:z=h}var T=h;h=z;try{return $()}finally{h=T}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,z){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var T=h;h=$;try{return z()}finally{h=T}},e.unstable_scheduleCallback=function($,z,T){var q=e.unstable_now();switch(typeof T=="object"&&T!==null?(T=T.delay,T=typeof T=="number"&&0<T?q+T:q):T=q,$){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=T+I,$={id:c++,callback:z,priorityLevel:$,startTime:T,expirationTime:I,sortIndex:-1},T>q?($.sortIndex=T,t(u,$),n(l)===null&&$===n(u)&&(m?(b(A),A=-1):m=!0,F(k,T-q))):($.sortIndex=I,t(l,$),p||d||(p=!0,B(w))),$},e.unstable_shouldYield=j,e.unstable_wrapCallback=function($){var z=h;return function(){var T=h;h=z;try{return $.apply(this,arguments)}finally{h=T}}}})(XD);QD.exports=XD;var RU=QD.exports;/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.min.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var DU=C,Ar=RU;function Z(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var YD=new Set,gh={};function sl(e,t){Mu(e,t),Mu(e+"Capture",t)}function Mu(e,t){for(gh[e]=t,e=0;e<t.length;e++)YD.add(t[e])}var Co=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$1=Object.prototype.hasOwnProperty,LU=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,gE={},yE={};function $U(e){return $1.call(yE,e)?!0:$1.call(gE,e)?!1:LU.test(e)?yE[e]=!0:(gE[e]=!0,!1)}function BU(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function FU(e,t,n,r){if(t===null||typeof t>"u"||BU(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function $n(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var hn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){hn[e]=new $n(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];hn[t]=new $n(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){hn[e]=new $n(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){hn[e]=new $n(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){hn[e]=new $n(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){hn[e]=new $n(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){hn[e]=new $n(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){hn[e]=new $n(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){hn[e]=new $n(e,5,!1,e.toLowerCase(),null,!1,!1)});var VO=/[\-:]([a-z])/g;function qO(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(VO,qO);hn[t]=new $n(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(VO,qO);hn[t]=new $n(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(VO,qO);hn[t]=new $n(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){hn[e]=new $n(e,1,!1,e.toLowerCase(),null,!1,!1)});hn.xlinkHref=new $n("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){hn[e]=new $n(e,1,!1,e.toLowerCase(),null,!0,!0)});function KO(e,t,n,r){var i=hn.hasOwnProperty(t)?hn[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(FU(t,n,i,r)&&(n=null),r||i===null?$U(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Lo=DU.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,yp=Symbol.for("react.element"),Wl=Symbol.for("react.portal"),Ul=Symbol.for("react.fragment"),GO=Symbol.for("react.strict_mode"),B1=Symbol.for("react.profiler"),ZD=Symbol.for("react.provider"),JD=Symbol.for("react.context"),QO=Symbol.for("react.forward_ref"),F1=Symbol.for("react.suspense"),z1=Symbol.for("react.suspense_list"),XO=Symbol.for("react.memo"),qo=Symbol.for("react.lazy"),eL=Symbol.for("react.offscreen"),vE=Symbol.iterator;function Yc(e){return e===null||typeof e!="object"?null:(e=vE&&e[vE]||e["@@iterator"],typeof e=="function"?e:null)}var St=Object.assign,kb;function jf(e){if(kb===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);kb=t&&t[1]||""}return`
|
|
34
|
-
`+kb+e}var Ob=!1;function Cb(e,t){if(!e||Ob)return"";Ob=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
|
|
35
|
-
`),o=r.stack.split(`
|
|
36
|
-
`),s=i.length-1,a=o.length-1;1<=s&&0<=a&&i[s]!==o[a];)a--;for(;1<=s&&0<=a;s--,a--)if(i[s]!==o[a]){if(s!==1||a!==1)do if(s--,a--,0>a||i[s]!==o[a]){var l=`
|
|
37
|
-
`+i[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Ob=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?jf(e):""}function zU(e){switch(e.tag){case 5:return jf(e.type);case 16:return jf("Lazy");case 13:return jf("Suspense");case 19:return jf("SuspenseList");case 0:case 2:case 15:return e=Cb(e.type,!1),e;case 11:return e=Cb(e.type.render,!1),e;case 1:return e=Cb(e.type,!0),e;default:return""}}function W1(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ul:return"Fragment";case Wl:return"Portal";case B1:return"Profiler";case GO:return"StrictMode";case F1:return"Suspense";case z1:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case JD:return(e.displayName||"Context")+".Consumer";case ZD:return(e._context.displayName||"Context")+".Provider";case QO:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case XO:return t=e.displayName||null,t!==null?t:W1(e.type)||"Memo";case qo:t=e._payload,e=e._init;try{return W1(e(t))}catch{}}return null}function WU(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return W1(t);case 8:return t===GO?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Cs(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function tL(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function UU(e){var t=tL(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function vp(e){e._valueTracker||(e._valueTracker=UU(e))}function nL(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=tL(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ug(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function U1(e,t){var n=t.checked;return St({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function bE(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Cs(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function rL(e,t){t=t.checked,t!=null&&KO(e,"checked",t,!1)}function H1(e,t){rL(e,t);var n=Cs(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?V1(e,t.type,n):t.hasOwnProperty("defaultValue")&&V1(e,t.type,Cs(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function xE(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function V1(e,t,n){(t!=="number"||ug(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Mf=Array.isArray;function fu(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Cs(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function q1(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Z(91));return St({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function wE(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(Z(92));if(Mf(n)){if(1<n.length)throw Error(Z(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Cs(n)}}function iL(e,t){var n=Cs(t.value),r=Cs(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function SE(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function oL(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function K1(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?oL(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var bp,sL=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(bp=bp||document.createElement("div"),bp.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=bp.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function yh(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var zf={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},HU=["Webkit","ms","Moz","O"];Object.keys(zf).forEach(function(e){HU.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),zf[t]=zf[e]})});function aL(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||zf.hasOwnProperty(e)&&zf[e]?(""+t).trim():t+"px"}function lL(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=aL(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var VU=St({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function G1(e,t){if(t){if(VU[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Z(62))}}function Q1(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var X1=null;function YO(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Y1=null,hu=null,du=null;function kE(e){if(e=Gd(e)){if(typeof Y1!="function")throw Error(Z(280));var t=e.stateNode;t&&(t=Dv(t),Y1(e.stateNode,e.type,t))}}function uL(e){hu?du?du.push(e):du=[e]:hu=e}function cL(){if(hu){var e=hu,t=du;if(du=hu=null,kE(e),t)for(e=0;e<t.length;e++)kE(t[e])}}function fL(e,t){return e(t)}function hL(){}var Ab=!1;function dL(e,t,n){if(Ab)return e(t,n);Ab=!0;try{return fL(e,t,n)}finally{Ab=!1,(hu!==null||du!==null)&&(hL(),cL())}}function vh(e,t){var n=e.stateNode;if(n===null)return null;var r=Dv(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(Z(231,t,typeof n));return n}var Z1=!1;if(Co)try{var Zc={};Object.defineProperty(Zc,"passive",{get:function(){Z1=!0}}),window.addEventListener("test",Zc,Zc),window.removeEventListener("test",Zc,Zc)}catch{Z1=!1}function qU(e,t,n,r,i,o,s,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var Wf=!1,cg=null,fg=!1,J1=null,KU={onError:function(e){Wf=!0,cg=e}};function GU(e,t,n,r,i,o,s,a,l){Wf=!1,cg=null,qU.apply(KU,arguments)}function QU(e,t,n,r,i,o,s,a,l){if(GU.apply(this,arguments),Wf){if(Wf){var u=cg;Wf=!1,cg=null}else throw Error(Z(198));fg||(fg=!0,J1=u)}}function al(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function pL(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function OE(e){if(al(e)!==e)throw Error(Z(188))}function XU(e){var t=e.alternate;if(!t){if(t=al(e),t===null)throw Error(Z(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return OE(i),e;if(o===r)return OE(i),t;o=o.sibling}throw Error(Z(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s){for(a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s)throw Error(Z(189))}}if(n.alternate!==r)throw Error(Z(190))}if(n.tag!==3)throw Error(Z(188));return n.stateNode.current===n?e:t}function mL(e){return e=XU(e),e!==null?gL(e):null}function gL(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=gL(e);if(t!==null)return t;e=e.sibling}return null}var yL=Ar.unstable_scheduleCallback,CE=Ar.unstable_cancelCallback,YU=Ar.unstable_shouldYield,ZU=Ar.unstable_requestPaint,_t=Ar.unstable_now,JU=Ar.unstable_getCurrentPriorityLevel,ZO=Ar.unstable_ImmediatePriority,vL=Ar.unstable_UserBlockingPriority,hg=Ar.unstable_NormalPriority,eH=Ar.unstable_LowPriority,bL=Ar.unstable_IdlePriority,Mv=null,Fi=null;function tH(e){if(Fi&&typeof Fi.onCommitFiberRoot=="function")try{Fi.onCommitFiberRoot(Mv,e,void 0,(e.current.flags&128)===128)}catch{}}var di=Math.clz32?Math.clz32:iH,nH=Math.log,rH=Math.LN2;function iH(e){return e>>>=0,e===0?32:31-(nH(e)/rH|0)|0}var xp=64,wp=4194304;function If(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function dg(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=If(a):(o&=s,o!==0&&(r=If(o)))}else s=n&~i,s!==0?r=If(s):o!==0&&(r=If(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-di(t),i=1<<n,r|=e[n],t&=~i;return r}function oH(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function sH(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var s=31-di(o),a=1<<s,l=i[s];l===-1?(!(a&n)||a&r)&&(i[s]=oH(a,t)):l<=t&&(e.expiredLanes|=a),o&=~a}}function ew(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function xL(){var e=xp;return xp<<=1,!(xp&4194240)&&(xp=64),e}function Pb(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function qd(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-di(t),e[t]=n}function aH(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-di(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}function JO(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-di(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Ve=0;function wL(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var SL,eC,kL,OL,CL,tw=!1,Sp=[],fs=null,hs=null,ds=null,bh=new Map,xh=new Map,Zo=[],lH="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function AE(e,t){switch(e){case"focusin":case"focusout":fs=null;break;case"dragenter":case"dragleave":hs=null;break;case"mouseover":case"mouseout":ds=null;break;case"pointerover":case"pointerout":bh.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":xh.delete(t.pointerId)}}function Jc(e,t,n,r,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},t!==null&&(t=Gd(t),t!==null&&eC(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function uH(e,t,n,r,i){switch(t){case"focusin":return fs=Jc(fs,e,t,n,r,i),!0;case"dragenter":return hs=Jc(hs,e,t,n,r,i),!0;case"mouseover":return ds=Jc(ds,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return bh.set(o,Jc(bh.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,xh.set(o,Jc(xh.get(o)||null,e,t,n,r,i)),!0}return!1}function AL(e){var t=ya(e.target);if(t!==null){var n=al(t);if(n!==null){if(t=n.tag,t===13){if(t=pL(n),t!==null){e.blockedOn=t,CL(e.priority,function(){kL(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Rm(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=nw(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);X1=r,n.target.dispatchEvent(r),X1=null}else return t=Gd(n),t!==null&&eC(t),e.blockedOn=n,!1;t.shift()}return!0}function PE(e,t,n){Rm(e)&&n.delete(t)}function cH(){tw=!1,fs!==null&&Rm(fs)&&(fs=null),hs!==null&&Rm(hs)&&(hs=null),ds!==null&&Rm(ds)&&(ds=null),bh.forEach(PE),xh.forEach(PE)}function ef(e,t){e.blockedOn===t&&(e.blockedOn=null,tw||(tw=!0,Ar.unstable_scheduleCallback(Ar.unstable_NormalPriority,cH)))}function wh(e){function t(i){return ef(i,e)}if(0<Sp.length){ef(Sp[0],e);for(var n=1;n<Sp.length;n++){var r=Sp[n];r.blockedOn===e&&(r.blockedOn=null)}}for(fs!==null&&ef(fs,e),hs!==null&&ef(hs,e),ds!==null&&ef(ds,e),bh.forEach(t),xh.forEach(t),n=0;n<Zo.length;n++)r=Zo[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Zo.length&&(n=Zo[0],n.blockedOn===null);)AL(n),n.blockedOn===null&&Zo.shift()}var pu=Lo.ReactCurrentBatchConfig,pg=!0;function fH(e,t,n,r){var i=Ve,o=pu.transition;pu.transition=null;try{Ve=1,tC(e,t,n,r)}finally{Ve=i,pu.transition=o}}function hH(e,t,n,r){var i=Ve,o=pu.transition;pu.transition=null;try{Ve=4,tC(e,t,n,r)}finally{Ve=i,pu.transition=o}}function tC(e,t,n,r){if(pg){var i=nw(e,t,n,r);if(i===null)Lb(e,t,r,mg,n),AE(e,r);else if(uH(i,e,t,n,r))r.stopPropagation();else if(AE(e,r),t&4&&-1<lH.indexOf(e)){for(;i!==null;){var o=Gd(i);if(o!==null&&SL(o),o=nw(e,t,n,r),o===null&&Lb(e,t,r,mg,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else Lb(e,t,r,null,n)}}var mg=null;function nw(e,t,n,r){if(mg=null,e=YO(r),e=ya(e),e!==null)if(t=al(e),t===null)e=null;else if(n=t.tag,n===13){if(e=pL(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return mg=e,null}function PL(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(JU()){case ZO:return 1;case vL:return 4;case hg:case eH:return 16;case bL:return 536870912;default:return 16}default:return 16}}var ns=null,nC=null,Dm=null;function EL(){if(Dm)return Dm;var e,t=nC,n=t.length,r,i="value"in ns?ns.value:ns.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===i[o-r];r++);return Dm=i.slice(e,1<r?1-r:void 0)}function Lm(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function kp(){return!0}function EE(){return!1}function Er(e){function t(n,r,i,o,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(o):o[a]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?kp:EE,this.isPropagationStopped=EE,this}return St(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=kp)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=kp)},persist:function(){},isPersistent:kp}),t}var Oc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rC=Er(Oc),Kd=St({},Oc,{view:0,detail:0}),dH=Er(Kd),Eb,Tb,tf,Iv=St({},Kd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:iC,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==tf&&(tf&&e.type==="mousemove"?(Eb=e.screenX-tf.screenX,Tb=e.screenY-tf.screenY):Tb=Eb=0,tf=e),Eb)},movementY:function(e){return"movementY"in e?e.movementY:Tb}}),TE=Er(Iv),pH=St({},Iv,{dataTransfer:0}),mH=Er(pH),gH=St({},Kd,{relatedTarget:0}),_b=Er(gH),yH=St({},Oc,{animationName:0,elapsedTime:0,pseudoElement:0}),vH=Er(yH),bH=St({},Oc,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),xH=Er(bH),wH=St({},Oc,{data:0}),_E=Er(wH),SH={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},kH={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},OH={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function CH(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=OH[e])?!!t[e]:!1}function iC(){return CH}var AH=St({},Kd,{key:function(e){if(e.key){var t=SH[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Lm(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?kH[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:iC,charCode:function(e){return e.type==="keypress"?Lm(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Lm(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),PH=Er(AH),EH=St({},Iv,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jE=Er(EH),TH=St({},Kd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:iC}),_H=Er(TH),jH=St({},Oc,{propertyName:0,elapsedTime:0,pseudoElement:0}),MH=Er(jH),IH=St({},Iv,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),NH=Er(IH),RH=[9,13,27,32],oC=Co&&"CompositionEvent"in window,Uf=null;Co&&"documentMode"in document&&(Uf=document.documentMode);var DH=Co&&"TextEvent"in window&&!Uf,TL=Co&&(!oC||Uf&&8<Uf&&11>=Uf),ME=" ",IE=!1;function _L(e,t){switch(e){case"keyup":return RH.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jL(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Hl=!1;function LH(e,t){switch(e){case"compositionend":return jL(t);case"keypress":return t.which!==32?null:(IE=!0,ME);case"textInput":return e=t.data,e===ME&&IE?null:e;default:return null}}function $H(e,t){if(Hl)return e==="compositionend"||!oC&&_L(e,t)?(e=EL(),Dm=nC=ns=null,Hl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return TL&&t.locale!=="ko"?null:t.data;default:return null}}var BH={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function NE(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!BH[e.type]:t==="textarea"}function ML(e,t,n,r){uL(r),t=gg(t,"onChange"),0<t.length&&(n=new rC("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Hf=null,Sh=null;function FH(e){UL(e,0)}function Nv(e){var t=Kl(e);if(nL(t))return e}function zH(e,t){if(e==="change")return t}var IL=!1;if(Co){var jb;if(Co){var Mb="oninput"in document;if(!Mb){var RE=document.createElement("div");RE.setAttribute("oninput","return;"),Mb=typeof RE.oninput=="function"}jb=Mb}else jb=!1;IL=jb&&(!document.documentMode||9<document.documentMode)}function DE(){Hf&&(Hf.detachEvent("onpropertychange",NL),Sh=Hf=null)}function NL(e){if(e.propertyName==="value"&&Nv(Sh)){var t=[];ML(t,Sh,e,YO(e)),dL(FH,t)}}function WH(e,t,n){e==="focusin"?(DE(),Hf=t,Sh=n,Hf.attachEvent("onpropertychange",NL)):e==="focusout"&&DE()}function UH(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Nv(Sh)}function HH(e,t){if(e==="click")return Nv(t)}function VH(e,t){if(e==="input"||e==="change")return Nv(t)}function qH(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var mi=typeof Object.is=="function"?Object.is:qH;function kh(e,t){if(mi(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!$1.call(t,i)||!mi(e[i],t[i]))return!1}return!0}function LE(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function $E(e,t){var n=LE(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=LE(n)}}function RL(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?RL(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function DL(){for(var e=window,t=ug();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ug(e.document)}return t}function sC(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function KH(e){var t=DL(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&RL(n.ownerDocument.documentElement,n)){if(r!==null&&sC(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=$E(n,o);var s=$E(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var GH=Co&&"documentMode"in document&&11>=document.documentMode,Vl=null,rw=null,Vf=null,iw=!1;function BE(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;iw||Vl==null||Vl!==ug(r)||(r=Vl,"selectionStart"in r&&sC(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Vf&&kh(Vf,r)||(Vf=r,r=gg(rw,"onSelect"),0<r.length&&(t=new rC("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Vl)))}function Op(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ql={animationend:Op("Animation","AnimationEnd"),animationiteration:Op("Animation","AnimationIteration"),animationstart:Op("Animation","AnimationStart"),transitionend:Op("Transition","TransitionEnd")},Ib={},LL={};Co&&(LL=document.createElement("div").style,"AnimationEvent"in window||(delete ql.animationend.animation,delete ql.animationiteration.animation,delete ql.animationstart.animation),"TransitionEvent"in window||delete ql.transitionend.transition);function Rv(e){if(Ib[e])return Ib[e];if(!ql[e])return e;var t=ql[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in LL)return Ib[e]=t[n];return e}var $L=Rv("animationend"),BL=Rv("animationiteration"),FL=Rv("animationstart"),zL=Rv("transitionend"),WL=new Map,FE="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function $s(e,t){WL.set(e,t),sl(t,[e])}for(var Nb=0;Nb<FE.length;Nb++){var Rb=FE[Nb],QH=Rb.toLowerCase(),XH=Rb[0].toUpperCase()+Rb.slice(1);$s(QH,"on"+XH)}$s($L,"onAnimationEnd");$s(BL,"onAnimationIteration");$s(FL,"onAnimationStart");$s("dblclick","onDoubleClick");$s("focusin","onFocus");$s("focusout","onBlur");$s(zL,"onTransitionEnd");Mu("onMouseEnter",["mouseout","mouseover"]);Mu("onMouseLeave",["mouseout","mouseover"]);Mu("onPointerEnter",["pointerout","pointerover"]);Mu("onPointerLeave",["pointerout","pointerover"]);sl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));sl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));sl("onBeforeInput",["compositionend","keypress","textInput","paste"]);sl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));sl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));sl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nf="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),YH=new Set("cancel close invalid load scroll toggle".split(" ").concat(Nf));function zE(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,QU(r,t,void 0,e),e.currentTarget=null}function UL(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==o&&i.isPropagationStopped())break e;zE(i,a,u),o=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,u=a.currentTarget,a=a.listener,l!==o&&i.isPropagationStopped())break e;zE(i,a,u),o=l}}}if(fg)throw e=J1,fg=!1,J1=null,e}function lt(e,t){var n=t[uw];n===void 0&&(n=t[uw]=new Set);var r=e+"__bubble";n.has(r)||(HL(t,e,2,!1),n.add(r))}function Db(e,t,n){var r=0;t&&(r|=4),HL(n,e,r,t)}var Cp="_reactListening"+Math.random().toString(36).slice(2);function Oh(e){if(!e[Cp]){e[Cp]=!0,YD.forEach(function(n){n!=="selectionchange"&&(YH.has(n)||Db(n,!1,e),Db(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Cp]||(t[Cp]=!0,Db("selectionchange",!1,t))}}function HL(e,t,n,r){switch(PL(t)){case 1:var i=fH;break;case 4:i=hH;break;default:i=tC}n=i.bind(null,t,n,e),i=void 0,!Z1||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Lb(e,t,n,r,i){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;s=s.return}for(;a!==null;){if(s=ya(a),s===null)return;if(l=s.tag,l===5||l===6){r=o=s;continue e}a=a.parentNode}}r=r.return}dL(function(){var u=o,c=YO(n),f=[];e:{var h=WL.get(e);if(h!==void 0){var d=rC,p=e;switch(e){case"keypress":if(Lm(n)===0)break e;case"keydown":case"keyup":d=PH;break;case"focusin":p="focus",d=_b;break;case"focusout":p="blur",d=_b;break;case"beforeblur":case"afterblur":d=_b;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":d=TE;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":d=mH;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":d=_H;break;case $L:case BL:case FL:d=vH;break;case zL:d=MH;break;case"scroll":d=dH;break;case"wheel":d=NH;break;case"copy":case"cut":case"paste":d=xH;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":d=jE}var m=(t&4)!==0,v=!m&&e==="scroll",b=m?h!==null?h+"Capture":null:h;m=[];for(var y=u,x;y!==null;){x=y;var k=x.stateNode;if(x.tag===5&&k!==null&&(x=k,b!==null&&(k=vh(y,b),k!=null&&m.push(Ch(y,k,x)))),v)break;y=y.return}0<m.length&&(h=new d(h,p,null,n,c),f.push({event:h,listeners:m}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",d=e==="mouseout"||e==="pointerout",h&&n!==X1&&(p=n.relatedTarget||n.fromElement)&&(ya(p)||p[Ao]))break e;if((d||h)&&(h=c.window===c?c:(h=c.ownerDocument)?h.defaultView||h.parentWindow:window,d?(p=n.relatedTarget||n.toElement,d=u,p=p?ya(p):null,p!==null&&(v=al(p),p!==v||p.tag!==5&&p.tag!==6)&&(p=null)):(d=null,p=u),d!==p)){if(m=TE,k="onMouseLeave",b="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(m=jE,k="onPointerLeave",b="onPointerEnter",y="pointer"),v=d==null?h:Kl(d),x=p==null?h:Kl(p),h=new m(k,y+"leave",d,n,c),h.target=v,h.relatedTarget=x,k=null,ya(c)===u&&(m=new m(b,y+"enter",p,n,c),m.target=x,m.relatedTarget=v,k=m),v=k,d&&p)t:{for(m=d,b=p,y=0,x=m;x;x=wl(x))y++;for(x=0,k=b;k;k=wl(k))x++;for(;0<y-x;)m=wl(m),y--;for(;0<x-y;)b=wl(b),x--;for(;y--;){if(m===b||b!==null&&m===b.alternate)break t;m=wl(m),b=wl(b)}m=null}else m=null;d!==null&&WE(f,h,d,m,!1),p!==null&&v!==null&&WE(f,v,p,m,!0)}}e:{if(h=u?Kl(u):window,d=h.nodeName&&h.nodeName.toLowerCase(),d==="select"||d==="input"&&h.type==="file")var w=zH;else if(NE(h))if(IL)w=VH;else{w=UH;var S=WH}else(d=h.nodeName)&&d.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(w=HH);if(w&&(w=w(e,u))){ML(f,w,n,c);break e}S&&S(e,h,u),e==="focusout"&&(S=h._wrapperState)&&S.controlled&&h.type==="number"&&V1(h,"number",h.value)}switch(S=u?Kl(u):window,e){case"focusin":(NE(S)||S.contentEditable==="true")&&(Vl=S,rw=u,Vf=null);break;case"focusout":Vf=rw=Vl=null;break;case"mousedown":iw=!0;break;case"contextmenu":case"mouseup":case"dragend":iw=!1,BE(f,n,c);break;case"selectionchange":if(GH)break;case"keydown":case"keyup":BE(f,n,c)}var O;if(oC)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else Hl?_L(e,n)&&(A="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(A="onCompositionStart");A&&(TL&&n.locale!=="ko"&&(Hl||A!=="onCompositionStart"?A==="onCompositionEnd"&&Hl&&(O=EL()):(ns=c,nC="value"in ns?ns.value:ns.textContent,Hl=!0)),S=gg(u,A),0<S.length&&(A=new _E(A,e,null,n,c),f.push({event:A,listeners:S}),O?A.data=O:(O=jL(n),O!==null&&(A.data=O)))),(O=DH?LH(e,n):$H(e,n))&&(u=gg(u,"onBeforeInput"),0<u.length&&(c=new _E("onBeforeInput","beforeinput",null,n,c),f.push({event:c,listeners:u}),c.data=O))}UL(f,t)})}function Ch(e,t,n){return{instance:e,listener:t,currentTarget:n}}function gg(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=vh(e,n),o!=null&&r.unshift(Ch(e,o,i)),o=vh(e,t),o!=null&&r.push(Ch(e,o,i))),e=e.return}return r}function wl(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function WE(e,t,n,r,i){for(var o=t._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,i?(l=vh(n,o),l!=null&&s.unshift(Ch(n,l,a))):i||(l=vh(n,o),l!=null&&s.push(Ch(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var ZH=/\r\n?/g,JH=/\u0000|\uFFFD/g;function UE(e){return(typeof e=="string"?e:""+e).replace(ZH,`
|
|
38
|
-
`).replace(JH,"")}function Ap(e,t,n){if(t=UE(t),UE(e)!==t&&n)throw Error(Z(425))}function yg(){}var ow=null,sw=null;function aw(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var lw=typeof setTimeout=="function"?setTimeout:void 0,e7=typeof clearTimeout=="function"?clearTimeout:void 0,HE=typeof Promise=="function"?Promise:void 0,t7=typeof queueMicrotask=="function"?queueMicrotask:typeof HE<"u"?function(e){return HE.resolve(null).then(e).catch(n7)}:lw;function n7(e){setTimeout(function(){throw e})}function $b(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),wh(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);wh(t)}function ps(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function VE(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Cc=Math.random().toString(36).slice(2),_i="__reactFiber$"+Cc,Ah="__reactProps$"+Cc,Ao="__reactContainer$"+Cc,uw="__reactEvents$"+Cc,r7="__reactListeners$"+Cc,i7="__reactHandles$"+Cc;function ya(e){var t=e[_i];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ao]||n[_i]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=VE(e);e!==null;){if(n=e[_i])return n;e=VE(e)}return t}e=n,n=e.parentNode}return null}function Gd(e){return e=e[_i]||e[Ao],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Kl(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Z(33))}function Dv(e){return e[Ah]||null}var cw=[],Gl=-1;function Bs(e){return{current:e}}function ht(e){0>Gl||(e.current=cw[Gl],cw[Gl]=null,Gl--)}function it(e,t){Gl++,cw[Gl]=e.current,e.current=t}var As={},bn=Bs(As),Xn=Bs(!1),Ua=As;function Iu(e,t){var n=e.type.contextTypes;if(!n)return As;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Yn(e){return e=e.childContextTypes,e!=null}function vg(){ht(Xn),ht(bn)}function qE(e,t,n){if(bn.current!==As)throw Error(Z(168));it(bn,t),it(Xn,n)}function VL(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(Z(108,WU(e)||"Unknown",i));return St({},n,r)}function bg(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||As,Ua=bn.current,it(bn,e),it(Xn,Xn.current),!0}function KE(e,t,n){var r=e.stateNode;if(!r)throw Error(Z(169));n?(e=VL(e,t,Ua),r.__reactInternalMemoizedMergedChildContext=e,ht(Xn),ht(bn),it(bn,e)):ht(Xn),it(Xn,n)}var so=null,Lv=!1,Bb=!1;function qL(e){so===null?so=[e]:so.push(e)}function o7(e){Lv=!0,qL(e)}function Fs(){if(!Bb&&so!==null){Bb=!0;var e=0,t=Ve;try{var n=so;for(Ve=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}so=null,Lv=!1}catch(i){throw so!==null&&(so=so.slice(e+1)),yL(ZO,Fs),i}finally{Ve=t,Bb=!1}}return null}var Ql=[],Xl=0,xg=null,wg=0,Rr=[],Dr=0,Ha=null,fo=1,ho="";function sa(e,t){Ql[Xl++]=wg,Ql[Xl++]=xg,xg=e,wg=t}function KL(e,t,n){Rr[Dr++]=fo,Rr[Dr++]=ho,Rr[Dr++]=Ha,Ha=e;var r=fo;e=ho;var i=32-di(r)-1;r&=~(1<<i),n+=1;var o=32-di(t)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,fo=1<<32-di(t)+i|n<<i|r,ho=o+e}else fo=1<<o|n<<i|r,ho=e}function aC(e){e.return!==null&&(sa(e,1),KL(e,1,0))}function lC(e){for(;e===xg;)xg=Ql[--Xl],Ql[Xl]=null,wg=Ql[--Xl],Ql[Xl]=null;for(;e===Ha;)Ha=Rr[--Dr],Rr[Dr]=null,ho=Rr[--Dr],Rr[Dr]=null,fo=Rr[--Dr],Rr[Dr]=null}var Sr=null,br=null,mt=!1,li=null;function GL(e,t){var n=Br(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function GE(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Sr=e,br=ps(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Sr=e,br=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ha!==null?{id:fo,overflow:ho}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Br(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Sr=e,br=null,!0):!1;default:return!1}}function fw(e){return(e.mode&1)!==0&&(e.flags&128)===0}function hw(e){if(mt){var t=br;if(t){var n=t;if(!GE(e,t)){if(fw(e))throw Error(Z(418));t=ps(n.nextSibling);var r=Sr;t&&GE(e,t)?GL(r,n):(e.flags=e.flags&-4097|2,mt=!1,Sr=e)}}else{if(fw(e))throw Error(Z(418));e.flags=e.flags&-4097|2,mt=!1,Sr=e}}}function QE(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Sr=e}function Pp(e){if(e!==Sr)return!1;if(!mt)return QE(e),mt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!aw(e.type,e.memoizedProps)),t&&(t=br)){if(fw(e))throw QL(),Error(Z(418));for(;t;)GL(e,t),t=ps(t.nextSibling)}if(QE(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Z(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){br=ps(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}br=null}}else br=Sr?ps(e.stateNode.nextSibling):null;return!0}function QL(){for(var e=br;e;)e=ps(e.nextSibling)}function Nu(){br=Sr=null,mt=!1}function uC(e){li===null?li=[e]:li.push(e)}var s7=Lo.ReactCurrentBatchConfig;function nf(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(Z(309));var r=n.stateNode}if(!r)throw Error(Z(147,e));var i=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(s){var a=i.refs;s===null?delete a[o]:a[o]=s},t._stringRef=o,t)}if(typeof e!="string")throw Error(Z(284));if(!n._owner)throw Error(Z(290,e))}return e}function Ep(e,t){throw e=Object.prototype.toString.call(t),Error(Z(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function XE(e){var t=e._init;return t(e._payload)}function XL(e){function t(b,y){if(e){var x=b.deletions;x===null?(b.deletions=[y],b.flags|=16):x.push(y)}}function n(b,y){if(!e)return null;for(;y!==null;)t(b,y),y=y.sibling;return null}function r(b,y){for(b=new Map;y!==null;)y.key!==null?b.set(y.key,y):b.set(y.index,y),y=y.sibling;return b}function i(b,y){return b=vs(b,y),b.index=0,b.sibling=null,b}function o(b,y,x){return b.index=x,e?(x=b.alternate,x!==null?(x=x.index,x<y?(b.flags|=2,y):x):(b.flags|=2,y)):(b.flags|=1048576,y)}function s(b){return e&&b.alternate===null&&(b.flags|=2),b}function a(b,y,x,k){return y===null||y.tag!==6?(y=qb(x,b.mode,k),y.return=b,y):(y=i(y,x),y.return=b,y)}function l(b,y,x,k){var w=x.type;return w===Ul?c(b,y,x.props.children,k,x.key):y!==null&&(y.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===qo&&XE(w)===y.type)?(k=i(y,x.props),k.ref=nf(b,y,x),k.return=b,k):(k=Hm(x.type,x.key,x.props,null,b.mode,k),k.ref=nf(b,y,x),k.return=b,k)}function u(b,y,x,k){return y===null||y.tag!==4||y.stateNode.containerInfo!==x.containerInfo||y.stateNode.implementation!==x.implementation?(y=Kb(x,b.mode,k),y.return=b,y):(y=i(y,x.children||[]),y.return=b,y)}function c(b,y,x,k,w){return y===null||y.tag!==7?(y=ja(x,b.mode,k,w),y.return=b,y):(y=i(y,x),y.return=b,y)}function f(b,y,x){if(typeof y=="string"&&y!==""||typeof y=="number")return y=qb(""+y,b.mode,x),y.return=b,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case yp:return x=Hm(y.type,y.key,y.props,null,b.mode,x),x.ref=nf(b,null,y),x.return=b,x;case Wl:return y=Kb(y,b.mode,x),y.return=b,y;case qo:var k=y._init;return f(b,k(y._payload),x)}if(Mf(y)||Yc(y))return y=ja(y,b.mode,x,null),y.return=b,y;Ep(b,y)}return null}function h(b,y,x,k){var w=y!==null?y.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return w!==null?null:a(b,y,""+x,k);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case yp:return x.key===w?l(b,y,x,k):null;case Wl:return x.key===w?u(b,y,x,k):null;case qo:return w=x._init,h(b,y,w(x._payload),k)}if(Mf(x)||Yc(x))return w!==null?null:c(b,y,x,k,null);Ep(b,x)}return null}function d(b,y,x,k,w){if(typeof k=="string"&&k!==""||typeof k=="number")return b=b.get(x)||null,a(y,b,""+k,w);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case yp:return b=b.get(k.key===null?x:k.key)||null,l(y,b,k,w);case Wl:return b=b.get(k.key===null?x:k.key)||null,u(y,b,k,w);case qo:var S=k._init;return d(b,y,x,S(k._payload),w)}if(Mf(k)||Yc(k))return b=b.get(x)||null,c(y,b,k,w,null);Ep(y,k)}return null}function p(b,y,x,k){for(var w=null,S=null,O=y,A=y=0,P=null;O!==null&&A<x.length;A++){O.index>A?(P=O,O=null):P=O.sibling;var M=h(b,O,x[A],k);if(M===null){O===null&&(O=P);break}e&&O&&M.alternate===null&&t(b,O),y=o(M,y,A),S===null?w=M:S.sibling=M,S=M,O=P}if(A===x.length)return n(b,O),mt&&sa(b,A),w;if(O===null){for(;A<x.length;A++)O=f(b,x[A],k),O!==null&&(y=o(O,y,A),S===null?w=O:S.sibling=O,S=O);return mt&&sa(b,A),w}for(O=r(b,O);A<x.length;A++)P=d(O,b,A,x[A],k),P!==null&&(e&&P.alternate!==null&&O.delete(P.key===null?A:P.key),y=o(P,y,A),S===null?w=P:S.sibling=P,S=P);return e&&O.forEach(function(j){return t(b,j)}),mt&&sa(b,A),w}function m(b,y,x,k){var w=Yc(x);if(typeof w!="function")throw Error(Z(150));if(x=w.call(x),x==null)throw Error(Z(151));for(var S=w=null,O=y,A=y=0,P=null,M=x.next();O!==null&&!M.done;A++,M=x.next()){O.index>A?(P=O,O=null):P=O.sibling;var j=h(b,O,M.value,k);if(j===null){O===null&&(O=P);break}e&&O&&j.alternate===null&&t(b,O),y=o(j,y,A),S===null?w=j:S.sibling=j,S=j,O=P}if(M.done)return n(b,O),mt&&sa(b,A),w;if(O===null){for(;!M.done;A++,M=x.next())M=f(b,M.value,k),M!==null&&(y=o(M,y,A),S===null?w=M:S.sibling=M,S=M);return mt&&sa(b,A),w}for(O=r(b,O);!M.done;A++,M=x.next())M=d(O,b,A,M.value,k),M!==null&&(e&&M.alternate!==null&&O.delete(M.key===null?A:M.key),y=o(M,y,A),S===null?w=M:S.sibling=M,S=M);return e&&O.forEach(function(E){return t(b,E)}),mt&&sa(b,A),w}function v(b,y,x,k){if(typeof x=="object"&&x!==null&&x.type===Ul&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case yp:e:{for(var w=x.key,S=y;S!==null;){if(S.key===w){if(w=x.type,w===Ul){if(S.tag===7){n(b,S.sibling),y=i(S,x.props.children),y.return=b,b=y;break e}}else if(S.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===qo&&XE(w)===S.type){n(b,S.sibling),y=i(S,x.props),y.ref=nf(b,S,x),y.return=b,b=y;break e}n(b,S);break}else t(b,S);S=S.sibling}x.type===Ul?(y=ja(x.props.children,b.mode,k,x.key),y.return=b,b=y):(k=Hm(x.type,x.key,x.props,null,b.mode,k),k.ref=nf(b,y,x),k.return=b,b=k)}return s(b);case Wl:e:{for(S=x.key;y!==null;){if(y.key===S)if(y.tag===4&&y.stateNode.containerInfo===x.containerInfo&&y.stateNode.implementation===x.implementation){n(b,y.sibling),y=i(y,x.children||[]),y.return=b,b=y;break e}else{n(b,y);break}else t(b,y);y=y.sibling}y=Kb(x,b.mode,k),y.return=b,b=y}return s(b);case qo:return S=x._init,v(b,y,S(x._payload),k)}if(Mf(x))return p(b,y,x,k);if(Yc(x))return m(b,y,x,k);Ep(b,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,y!==null&&y.tag===6?(n(b,y.sibling),y=i(y,x),y.return=b,b=y):(n(b,y),y=qb(x,b.mode,k),y.return=b,b=y),s(b)):n(b,y)}return v}var Ru=XL(!0),YL=XL(!1),Sg=Bs(null),kg=null,Yl=null,cC=null;function fC(){cC=Yl=kg=null}function hC(e){var t=Sg.current;ht(Sg),e._currentValue=t}function dw(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function mu(e,t){kg=e,cC=Yl=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Hn=!0),e.firstContext=null)}function qr(e){var t=e._currentValue;if(cC!==e)if(e={context:e,memoizedValue:t,next:null},Yl===null){if(kg===null)throw Error(Z(308));Yl=e,kg.dependencies={lanes:0,firstContext:e}}else Yl=Yl.next=e;return t}var va=null;function dC(e){va===null?va=[e]:va.push(e)}function ZL(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,dC(t)):(n.next=i.next,i.next=n),t.interleaved=n,Po(e,r)}function Po(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ko=!1;function pC(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function JL(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function yo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ms(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,De&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Po(e,n)}return i=r.interleaved,i===null?(t.next=t,dC(r)):(t.next=i.next,i.next=t),r.interleaved=t,Po(e,n)}function $m(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,JO(e,n)}}function YE(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Og(e,t,n,r){var i=e.updateQueue;Ko=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?o=u:s.next=u,s=l;var c=e.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==s&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(o!==null){var f=i.baseState;s=0,c=u=l=null,a=o;do{var h=a.lane,d=a.eventTime;if((r&h)===h){c!==null&&(c=c.next={eventTime:d,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var p=e,m=a;switch(h=t,d=n,m.tag){case 1:if(p=m.payload,typeof p=="function"){f=p.call(d,f,h);break e}f=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=m.payload,h=typeof p=="function"?p.call(d,f,h):p,h==null)break e;f=St({},f,h);break e;case 2:Ko=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[a]:h.push(a))}else d={eventTime:d,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=d,l=f):c=c.next=d,s|=h;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;h=a,a=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(c===null&&(l=f),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);qa|=s,e.lanes=s,e.memoizedState=f}}function ZE(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(Z(191,i));i.call(r)}}}var Qd={},zi=Bs(Qd),Ph=Bs(Qd),Eh=Bs(Qd);function ba(e){if(e===Qd)throw Error(Z(174));return e}function mC(e,t){switch(it(Eh,t),it(Ph,e),it(zi,Qd),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:K1(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=K1(t,e)}ht(zi),it(zi,t)}function Du(){ht(zi),ht(Ph),ht(Eh)}function e$(e){ba(Eh.current);var t=ba(zi.current),n=K1(t,e.type);t!==n&&(it(Ph,e),it(zi,n))}function gC(e){Ph.current===e&&(ht(zi),ht(Ph))}var bt=Bs(0);function Cg(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Fb=[];function yC(){for(var e=0;e<Fb.length;e++)Fb[e]._workInProgressVersionPrimary=null;Fb.length=0}var Bm=Lo.ReactCurrentDispatcher,zb=Lo.ReactCurrentBatchConfig,Va=0,xt=null,Ft=null,Xt=null,Ag=!1,qf=!1,Th=0,a7=0;function dn(){throw Error(Z(321))}function vC(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!mi(e[n],t[n]))return!1;return!0}function bC(e,t,n,r,i,o){if(Va=o,xt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Bm.current=e===null||e.memoizedState===null?f7:h7,e=n(r,i),qf){o=0;do{if(qf=!1,Th=0,25<=o)throw Error(Z(301));o+=1,Xt=Ft=null,t.updateQueue=null,Bm.current=d7,e=n(r,i)}while(qf)}if(Bm.current=Pg,t=Ft!==null&&Ft.next!==null,Va=0,Xt=Ft=xt=null,Ag=!1,t)throw Error(Z(300));return e}function xC(){var e=Th!==0;return Th=0,e}function Pi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xt===null?xt.memoizedState=Xt=e:Xt=Xt.next=e,Xt}function Kr(){if(Ft===null){var e=xt.alternate;e=e!==null?e.memoizedState:null}else e=Ft.next;var t=Xt===null?xt.memoizedState:Xt.next;if(t!==null)Xt=t,Ft=e;else{if(e===null)throw Error(Z(310));Ft=e,e={memoizedState:Ft.memoizedState,baseState:Ft.baseState,baseQueue:Ft.baseQueue,queue:Ft.queue,next:null},Xt===null?xt.memoizedState=Xt=e:Xt=Xt.next=e}return Xt}function _h(e,t){return typeof t=="function"?t(e):t}function Wb(e){var t=Kr(),n=t.queue;if(n===null)throw Error(Z(311));n.lastRenderedReducer=e;var r=Ft,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var a=s=null,l=null,u=o;do{var c=u.lane;if((Va&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=f,s=r):l=l.next=f,xt.lanes|=c,qa|=c}u=u.next}while(u!==null&&u!==o);l===null?s=r:l.next=a,mi(r,t.memoizedState)||(Hn=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do o=i.lane,xt.lanes|=o,qa|=o,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ub(e){var t=Kr(),n=t.queue;if(n===null)throw Error(Z(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);mi(o,t.memoizedState)||(Hn=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function t$(){}function n$(e,t){var n=xt,r=Kr(),i=t(),o=!mi(r.memoizedState,i);if(o&&(r.memoizedState=i,Hn=!0),r=r.queue,wC(o$.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||Xt!==null&&Xt.memoizedState.tag&1){if(n.flags|=2048,jh(9,i$.bind(null,n,r,i,t),void 0,null),en===null)throw Error(Z(349));Va&30||r$(n,t,i)}return i}function r$(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=xt.updateQueue,t===null?(t={lastEffect:null,stores:null},xt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function i$(e,t,n,r){t.value=n,t.getSnapshot=r,s$(t)&&a$(e)}function o$(e,t,n){return n(function(){s$(t)&&a$(e)})}function s$(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!mi(e,n)}catch{return!0}}function a$(e){var t=Po(e,1);t!==null&&pi(t,e,1,-1)}function JE(e){var t=Pi();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:_h,lastRenderedState:e},t.queue=e,e=e.dispatch=c7.bind(null,xt,e),[t.memoizedState,e]}function jh(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=xt.updateQueue,t===null?(t={lastEffect:null,stores:null},xt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function l$(){return Kr().memoizedState}function Fm(e,t,n,r){var i=Pi();xt.flags|=e,i.memoizedState=jh(1|t,n,void 0,r===void 0?null:r)}function $v(e,t,n,r){var i=Kr();r=r===void 0?null:r;var o=void 0;if(Ft!==null){var s=Ft.memoizedState;if(o=s.destroy,r!==null&&vC(r,s.deps)){i.memoizedState=jh(t,n,o,r);return}}xt.flags|=e,i.memoizedState=jh(1|t,n,o,r)}function eT(e,t){return Fm(8390656,8,e,t)}function wC(e,t){return $v(2048,8,e,t)}function u$(e,t){return $v(4,2,e,t)}function c$(e,t){return $v(4,4,e,t)}function f$(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function h$(e,t,n){return n=n!=null?n.concat([e]):null,$v(4,4,f$.bind(null,t,e),n)}function SC(){}function d$(e,t){var n=Kr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&vC(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function p$(e,t){var n=Kr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&vC(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function m$(e,t,n){return Va&21?(mi(n,t)||(n=xL(),xt.lanes|=n,qa|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Hn=!0),e.memoizedState=n)}function l7(e,t){var n=Ve;Ve=n!==0&&4>n?n:4,e(!0);var r=zb.transition;zb.transition={};try{e(!1),t()}finally{Ve=n,zb.transition=r}}function g$(){return Kr().memoizedState}function u7(e,t,n){var r=ys(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},y$(e))v$(t,n);else if(n=ZL(e,t,n,r),n!==null){var i=Rn();pi(n,e,r,i),b$(n,t,r)}}function c7(e,t,n){var r=ys(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(y$(e))v$(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,mi(a,s)){var l=t.interleaved;l===null?(i.next=i,dC(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=ZL(e,t,i,r),n!==null&&(i=Rn(),pi(n,e,r,i),b$(n,t,r))}}function y$(e){var t=e.alternate;return e===xt||t!==null&&t===xt}function v$(e,t){qf=Ag=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function b$(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,JO(e,n)}}var Pg={readContext:qr,useCallback:dn,useContext:dn,useEffect:dn,useImperativeHandle:dn,useInsertionEffect:dn,useLayoutEffect:dn,useMemo:dn,useReducer:dn,useRef:dn,useState:dn,useDebugValue:dn,useDeferredValue:dn,useTransition:dn,useMutableSource:dn,useSyncExternalStore:dn,useId:dn,unstable_isNewReconciler:!1},f7={readContext:qr,useCallback:function(e,t){return Pi().memoizedState=[e,t===void 0?null:t],e},useContext:qr,useEffect:eT,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Fm(4194308,4,f$.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Fm(4194308,4,e,t)},useInsertionEffect:function(e,t){return Fm(4,2,e,t)},useMemo:function(e,t){var n=Pi();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Pi();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=u7.bind(null,xt,e),[r.memoizedState,e]},useRef:function(e){var t=Pi();return e={current:e},t.memoizedState=e},useState:JE,useDebugValue:SC,useDeferredValue:function(e){return Pi().memoizedState=e},useTransition:function(){var e=JE(!1),t=e[0];return e=l7.bind(null,e[1]),Pi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=xt,i=Pi();if(mt){if(n===void 0)throw Error(Z(407));n=n()}else{if(n=t(),en===null)throw Error(Z(349));Va&30||r$(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,eT(o$.bind(null,r,o,e),[e]),r.flags|=2048,jh(9,i$.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Pi(),t=en.identifierPrefix;if(mt){var n=ho,r=fo;n=(r&~(1<<32-di(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Th++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=a7++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},h7={readContext:qr,useCallback:d$,useContext:qr,useEffect:wC,useImperativeHandle:h$,useInsertionEffect:u$,useLayoutEffect:c$,useMemo:p$,useReducer:Wb,useRef:l$,useState:function(){return Wb(_h)},useDebugValue:SC,useDeferredValue:function(e){var t=Kr();return m$(t,Ft.memoizedState,e)},useTransition:function(){var e=Wb(_h)[0],t=Kr().memoizedState;return[e,t]},useMutableSource:t$,useSyncExternalStore:n$,useId:g$,unstable_isNewReconciler:!1},d7={readContext:qr,useCallback:d$,useContext:qr,useEffect:wC,useImperativeHandle:h$,useInsertionEffect:u$,useLayoutEffect:c$,useMemo:p$,useReducer:Ub,useRef:l$,useState:function(){return Ub(_h)},useDebugValue:SC,useDeferredValue:function(e){var t=Kr();return Ft===null?t.memoizedState=e:m$(t,Ft.memoizedState,e)},useTransition:function(){var e=Ub(_h)[0],t=Kr().memoizedState;return[e,t]},useMutableSource:t$,useSyncExternalStore:n$,useId:g$,unstable_isNewReconciler:!1};function ri(e,t){if(e&&e.defaultProps){t=St({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function pw(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:St({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Bv={isMounted:function(e){return(e=e._reactInternals)?al(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Rn(),i=ys(e),o=yo(r,i);o.payload=t,n!=null&&(o.callback=n),t=ms(e,o,i),t!==null&&(pi(t,e,i,r),$m(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Rn(),i=ys(e),o=yo(r,i);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=ms(e,o,i),t!==null&&(pi(t,e,i,r),$m(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Rn(),r=ys(e),i=yo(n,r);i.tag=2,t!=null&&(i.callback=t),t=ms(e,i,r),t!==null&&(pi(t,e,r,n),$m(t,e,r))}};function tT(e,t,n,r,i,o,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,s):t.prototype&&t.prototype.isPureReactComponent?!kh(n,r)||!kh(i,o):!0}function x$(e,t,n){var r=!1,i=As,o=t.contextType;return typeof o=="object"&&o!==null?o=qr(o):(i=Yn(t)?Ua:bn.current,r=t.contextTypes,o=(r=r!=null)?Iu(e,i):As),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Bv,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function nT(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Bv.enqueueReplaceState(t,t.state,null)}function mw(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},pC(e);var o=t.contextType;typeof o=="object"&&o!==null?i.context=qr(o):(o=Yn(t)?Ua:bn.current,i.context=Iu(e,o)),i.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(pw(e,t,o,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Bv.enqueueReplaceState(i,i.state,null),Og(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Lu(e,t){try{var n="",r=t;do n+=zU(r),r=r.return;while(r);var i=n}catch(o){i=`
|
|
39
|
-
Error generating stack: `+o.message+`
|
|
40
|
-
`+o.stack}return{value:e,source:t,stack:i,digest:null}}function Hb(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function gw(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var p7=typeof WeakMap=="function"?WeakMap:Map;function w$(e,t,n){n=yo(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Tg||(Tg=!0,Aw=r),gw(e,t)},n}function S$(e,t,n){n=yo(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){gw(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){gw(e,t),typeof r!="function"&&(gs===null?gs=new Set([this]):gs.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function rT(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new p7;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=E7.bind(null,e,t,n),t.then(e,e))}function iT(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function oT(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=yo(-1,1),t.tag=2,ms(n,t,1))),n.lanes|=1),e)}var m7=Lo.ReactCurrentOwner,Hn=!1;function An(e,t,n,r){t.child=e===null?YL(t,null,n,r):Ru(t,e.child,n,r)}function sT(e,t,n,r,i){n=n.render;var o=t.ref;return mu(t,i),r=bC(e,t,n,r,o,i),n=xC(),e!==null&&!Hn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Eo(e,t,i)):(mt&&n&&aC(t),t.flags|=1,An(e,t,r,i),t.child)}function aT(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!_C(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,k$(e,t,o,r,i)):(e=Hm(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var s=o.memoizedProps;if(n=n.compare,n=n!==null?n:kh,n(s,r)&&e.ref===t.ref)return Eo(e,t,i)}return t.flags|=1,e=vs(o,r),e.ref=t.ref,e.return=t,t.child=e}function k$(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(kh(o,r)&&e.ref===t.ref)if(Hn=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(Hn=!0);else return t.lanes=e.lanes,Eo(e,t,i)}return yw(e,t,n,r,i)}function O$(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},it(Jl,dr),dr|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,it(Jl,dr),dr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,it(Jl,dr),dr|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,it(Jl,dr),dr|=r;return An(e,t,i,n),t.child}function C$(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function yw(e,t,n,r,i){var o=Yn(n)?Ua:bn.current;return o=Iu(t,o),mu(t,i),n=bC(e,t,n,r,o,i),r=xC(),e!==null&&!Hn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Eo(e,t,i)):(mt&&r&&aC(t),t.flags|=1,An(e,t,n,i),t.child)}function lT(e,t,n,r,i){if(Yn(n)){var o=!0;bg(t)}else o=!1;if(mu(t,i),t.stateNode===null)zm(e,t),x$(t,n,r),mw(t,n,r,i),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=qr(u):(u=Yn(n)?Ua:bn.current,u=Iu(t,u));var c=n.getDerivedStateFromProps,f=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==u)&&nT(t,s,r,u),Ko=!1;var h=t.memoizedState;s.state=h,Og(t,r,s,i),l=t.memoizedState,a!==r||h!==l||Xn.current||Ko?(typeof c=="function"&&(pw(t,n,c,r),l=t.memoizedState),(a=Ko||tT(t,n,a,r,h,l,u))?(f||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=u,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,JL(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:ri(t.type,a),s.props=u,f=t.pendingProps,h=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=qr(l):(l=Yn(n)?Ua:bn.current,l=Iu(t,l));var d=n.getDerivedStateFromProps;(c=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==f||h!==l)&&nT(t,s,r,l),Ko=!1,h=t.memoizedState,s.state=h,Og(t,r,s,i);var p=t.memoizedState;a!==f||h!==p||Xn.current||Ko?(typeof d=="function"&&(pw(t,n,d,r),p=t.memoizedState),(u=Ko||tT(t,n,u,r,h,p,l)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,p,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,p,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),s.props=r,s.state=p,s.context=l,r=u):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return vw(e,t,n,r,o,i)}function vw(e,t,n,r,i,o){C$(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return i&&KE(t,n,!1),Eo(e,t,o);r=t.stateNode,m7.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Ru(t,e.child,null,o),t.child=Ru(t,null,a,o)):An(e,t,a,o),t.memoizedState=r.state,i&&KE(t,n,!0),t.child}function A$(e){var t=e.stateNode;t.pendingContext?qE(e,t.pendingContext,t.pendingContext!==t.context):t.context&&qE(e,t.context,!1),mC(e,t.containerInfo)}function uT(e,t,n,r,i){return Nu(),uC(i),t.flags|=256,An(e,t,n,r),t.child}var bw={dehydrated:null,treeContext:null,retryLane:0};function xw(e){return{baseLanes:e,cachePool:null,transitions:null}}function P$(e,t,n){var r=t.pendingProps,i=bt.current,o=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),it(bt,i&1),e===null)return hw(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,o?(r=t.mode,o=t.child,s={mode:"hidden",children:s},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=s):o=Wv(s,r,0,null),e=ja(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=xw(n),t.memoizedState=bw,e):kC(t,s));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return g7(e,t,s,r,a,i,n);if(o){o=r.fallback,s=t.mode,i=e.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(s&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=vs(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?o=vs(a,o):(o=ja(o,s,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,s=e.child.memoizedState,s=s===null?xw(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=e.childLanes&~n,t.memoizedState=bw,r}return o=e.child,e=o.sibling,r=vs(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function kC(e,t){return t=Wv({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Tp(e,t,n,r){return r!==null&&uC(r),Ru(t,e.child,null,n),e=kC(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function g7(e,t,n,r,i,o,s){if(n)return t.flags&256?(t.flags&=-257,r=Hb(Error(Z(422))),Tp(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=Wv({mode:"visible",children:r.children},i,0,null),o=ja(o,i,s,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&Ru(t,e.child,null,s),t.child.memoizedState=xw(s),t.memoizedState=bw,o);if(!(t.mode&1))return Tp(e,t,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,o=Error(Z(419)),r=Hb(o,r,void 0),Tp(e,t,s,r)}if(a=(s&e.childLanes)!==0,Hn||a){if(r=en,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|s)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,Po(e,i),pi(r,e,i,-1))}return TC(),r=Hb(Error(Z(421))),Tp(e,t,s,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=T7.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,br=ps(i.nextSibling),Sr=t,mt=!0,li=null,e!==null&&(Rr[Dr++]=fo,Rr[Dr++]=ho,Rr[Dr++]=Ha,fo=e.id,ho=e.overflow,Ha=t),t=kC(t,r.children),t.flags|=4096,t)}function cT(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),dw(e.return,t,n)}function Vb(e,t,n,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function E$(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(An(e,t,r.children,n),r=bt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&cT(e,n,t);else if(e.tag===19)cT(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(it(bt,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Cg(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Vb(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Cg(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Vb(t,!0,n,null,o);break;case"together":Vb(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function zm(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Eo(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),qa|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Z(153));if(t.child!==null){for(e=t.child,n=vs(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=vs(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function y7(e,t,n){switch(t.tag){case 3:A$(t),Nu();break;case 5:e$(t);break;case 1:Yn(t.type)&&bg(t);break;case 4:mC(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;it(Sg,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(it(bt,bt.current&1),t.flags|=128,null):n&t.child.childLanes?P$(e,t,n):(it(bt,bt.current&1),e=Eo(e,t,n),e!==null?e.sibling:null);it(bt,bt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return E$(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),it(bt,bt.current),r)break;return null;case 22:case 23:return t.lanes=0,O$(e,t,n)}return Eo(e,t,n)}var T$,ww,_$,j$;T$=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};ww=function(){};_$=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,ba(zi.current);var o=null;switch(n){case"input":i=U1(e,i),r=U1(e,r),o=[];break;case"select":i=St({},i,{value:void 0}),r=St({},r,{value:void 0}),o=[];break;case"textarea":i=q1(e,i),r=q1(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=yg)}G1(n,r);var s;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var a=i[u];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(gh.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var l=r[u];if(a=i?.[u],r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(o||(o=[]),o.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(o=o||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(gh.hasOwnProperty(u)?(l!=null&&u==="onScroll"&<("scroll",e),o||a===l||(o=[])):(o=o||[]).push(u,l))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};j$=function(e,t,n,r){n!==r&&(t.flags|=4)};function rf(e,t){if(!mt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function pn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function v7(e,t,n){var r=t.pendingProps;switch(lC(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pn(t),null;case 1:return Yn(t.type)&&vg(),pn(t),null;case 3:return r=t.stateNode,Du(),ht(Xn),ht(bn),yC(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Pp(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,li!==null&&(Tw(li),li=null))),ww(e,t),pn(t),null;case 5:gC(t);var i=ba(Eh.current);if(n=t.type,e!==null&&t.stateNode!=null)_$(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(Z(166));return pn(t),null}if(e=ba(zi.current),Pp(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[_i]=t,r[Ah]=o,e=(t.mode&1)!==0,n){case"dialog":lt("cancel",r),lt("close",r);break;case"iframe":case"object":case"embed":lt("load",r);break;case"video":case"audio":for(i=0;i<Nf.length;i++)lt(Nf[i],r);break;case"source":lt("error",r);break;case"img":case"image":case"link":lt("error",r),lt("load",r);break;case"details":lt("toggle",r);break;case"input":bE(r,o),lt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},lt("invalid",r);break;case"textarea":wE(r,o),lt("invalid",r)}G1(n,o),i=null;for(var s in o)if(o.hasOwnProperty(s)){var a=o[s];s==="children"?typeof a=="string"?r.textContent!==a&&(o.suppressHydrationWarning!==!0&&Ap(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&Ap(r.textContent,a,e),i=["children",""+a]):gh.hasOwnProperty(s)&&a!=null&&s==="onScroll"&<("scroll",r)}switch(n){case"input":vp(r),xE(r,o,!0);break;case"textarea":vp(r),SE(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=yg)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=oL(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[_i]=t,e[Ah]=r,T$(e,t,!1,!1),t.stateNode=e;e:{switch(s=Q1(n,r),n){case"dialog":lt("cancel",e),lt("close",e),i=r;break;case"iframe":case"object":case"embed":lt("load",e),i=r;break;case"video":case"audio":for(i=0;i<Nf.length;i++)lt(Nf[i],e);i=r;break;case"source":lt("error",e),i=r;break;case"img":case"image":case"link":lt("error",e),lt("load",e),i=r;break;case"details":lt("toggle",e),i=r;break;case"input":bE(e,r),i=U1(e,r),lt("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=St({},r,{value:void 0}),lt("invalid",e);break;case"textarea":wE(e,r),i=q1(e,r),lt("invalid",e);break;default:i=r}G1(n,i),a=i;for(o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="style"?lL(e,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&sL(e,l)):o==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&yh(e,l):typeof l=="number"&&yh(e,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(gh.hasOwnProperty(o)?l!=null&&o==="onScroll"&<("scroll",e):l!=null&&KO(e,o,l,s))}switch(n){case"input":vp(e),xE(e,r,!1);break;case"textarea":vp(e),SE(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Cs(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?fu(e,!!r.multiple,o,!1):r.defaultValue!=null&&fu(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=yg)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return pn(t),null;case 6:if(e&&t.stateNode!=null)j$(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(Z(166));if(n=ba(Eh.current),ba(zi.current),Pp(t)){if(r=t.stateNode,n=t.memoizedProps,r[_i]=t,(o=r.nodeValue!==n)&&(e=Sr,e!==null))switch(e.tag){case 3:Ap(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ap(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[_i]=t,t.stateNode=r}return pn(t),null;case 13:if(ht(bt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(mt&&br!==null&&t.mode&1&&!(t.flags&128))QL(),Nu(),t.flags|=98560,o=!1;else if(o=Pp(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(Z(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(Z(317));o[_i]=t}else Nu(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;pn(t),o=!1}else li!==null&&(Tw(li),li=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||bt.current&1?Vt===0&&(Vt=3):TC())),t.updateQueue!==null&&(t.flags|=4),pn(t),null);case 4:return Du(),ww(e,t),e===null&&Oh(t.stateNode.containerInfo),pn(t),null;case 10:return hC(t.type._context),pn(t),null;case 17:return Yn(t.type)&&vg(),pn(t),null;case 19:if(ht(bt),o=t.memoizedState,o===null)return pn(t),null;if(r=(t.flags&128)!==0,s=o.rendering,s===null)if(r)rf(o,!1);else{if(Vt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Cg(e),s!==null){for(t.flags|=128,rf(o,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,s=o.alternate,s===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=s.childLanes,o.lanes=s.lanes,o.child=s.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=s.memoizedProps,o.memoizedState=s.memoizedState,o.updateQueue=s.updateQueue,o.type=s.type,e=s.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return it(bt,bt.current&1|2),t.child}e=e.sibling}o.tail!==null&&_t()>$u&&(t.flags|=128,r=!0,rf(o,!1),t.lanes=4194304)}else{if(!r)if(e=Cg(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),rf(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!mt)return pn(t),null}else 2*_t()-o.renderingStartTime>$u&&n!==1073741824&&(t.flags|=128,r=!0,rf(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=_t(),t.sibling=null,n=bt.current,it(bt,r?n&1|2:n&1),t):(pn(t),null);case 22:case 23:return EC(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?dr&1073741824&&(pn(t),t.subtreeFlags&6&&(t.flags|=8192)):pn(t),null;case 24:return null;case 25:return null}throw Error(Z(156,t.tag))}function b7(e,t){switch(lC(t),t.tag){case 1:return Yn(t.type)&&vg(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Du(),ht(Xn),ht(bn),yC(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return gC(t),null;case 13:if(ht(bt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Z(340));Nu()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ht(bt),null;case 4:return Du(),null;case 10:return hC(t.type._context),null;case 22:case 23:return EC(),null;case 24:return null;default:return null}}var _p=!1,yn=!1,x7=typeof WeakSet=="function"?WeakSet:Set,ae=null;function Zl(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ot(e,t,r)}else n.current=null}function Sw(e,t,n){try{n()}catch(r){Ot(e,t,r)}}var fT=!1;function w7(e,t){if(ow=pg,e=DL(),sC(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,c=0,f=e,h=null;t:for(;;){for(var d;f!==n||i!==0&&f.nodeType!==3||(a=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(d=f.firstChild)!==null;)h=f,f=d;for(;;){if(f===e)break t;if(h===n&&++u===i&&(a=s),h===o&&++c===r&&(l=s),(d=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=d}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(sw={focusedElem:e,selectionRange:n},pg=!1,ae=t;ae!==null;)if(t=ae,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ae=e;else for(;ae!==null;){t=ae;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var m=p.memoizedProps,v=p.memoizedState,b=t.stateNode,y=b.getSnapshotBeforeUpdate(t.elementType===t.type?m:ri(t.type,m),v);b.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Z(163))}}catch(k){Ot(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,ae=e;break}ae=t.return}return p=fT,fT=!1,p}function Kf(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&Sw(t,n,o)}i=i.next}while(i!==r)}}function Fv(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function kw(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function M$(e){var t=e.alternate;t!==null&&(e.alternate=null,M$(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[_i],delete t[Ah],delete t[uw],delete t[r7],delete t[i7])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function I$(e){return e.tag===5||e.tag===3||e.tag===4}function hT(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||I$(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ow(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=yg));else if(r!==4&&(e=e.child,e!==null))for(Ow(e,t,n),e=e.sibling;e!==null;)Ow(e,t,n),e=e.sibling}function Cw(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Cw(e,t,n),e=e.sibling;e!==null;)Cw(e,t,n),e=e.sibling}var sn=null,ii=!1;function Uo(e,t,n){for(n=n.child;n!==null;)N$(e,t,n),n=n.sibling}function N$(e,t,n){if(Fi&&typeof Fi.onCommitFiberUnmount=="function")try{Fi.onCommitFiberUnmount(Mv,n)}catch{}switch(n.tag){case 5:yn||Zl(n,t);case 6:var r=sn,i=ii;sn=null,Uo(e,t,n),sn=r,ii=i,sn!==null&&(ii?(e=sn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):sn.removeChild(n.stateNode));break;case 18:sn!==null&&(ii?(e=sn,n=n.stateNode,e.nodeType===8?$b(e.parentNode,n):e.nodeType===1&&$b(e,n),wh(e)):$b(sn,n.stateNode));break;case 4:r=sn,i=ii,sn=n.stateNode.containerInfo,ii=!0,Uo(e,t,n),sn=r,ii=i;break;case 0:case 11:case 14:case 15:if(!yn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&Sw(n,t,s),i=i.next}while(i!==r)}Uo(e,t,n);break;case 1:if(!yn&&(Zl(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ot(n,t,a)}Uo(e,t,n);break;case 21:Uo(e,t,n);break;case 22:n.mode&1?(yn=(r=yn)||n.memoizedState!==null,Uo(e,t,n),yn=r):Uo(e,t,n);break;default:Uo(e,t,n)}}function dT(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new x7),t.forEach(function(r){var i=_7.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function ti(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:sn=a.stateNode,ii=!1;break e;case 3:sn=a.stateNode.containerInfo,ii=!0;break e;case 4:sn=a.stateNode.containerInfo,ii=!0;break e}a=a.return}if(sn===null)throw Error(Z(160));N$(o,s,i),sn=null,ii=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){Ot(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)R$(t,e),t=t.sibling}function R$(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ti(t,e),Si(e),r&4){try{Kf(3,e,e.return),Fv(3,e)}catch(m){Ot(e,e.return,m)}try{Kf(5,e,e.return)}catch(m){Ot(e,e.return,m)}}break;case 1:ti(t,e),Si(e),r&512&&n!==null&&Zl(n,n.return);break;case 5:if(ti(t,e),Si(e),r&512&&n!==null&&Zl(n,n.return),e.flags&32){var i=e.stateNode;try{yh(i,"")}catch(m){Ot(e,e.return,m)}}if(r&4&&(i=e.stateNode,i!=null)){var o=e.memoizedProps,s=n!==null?n.memoizedProps:o,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&o.type==="radio"&&o.name!=null&&rL(i,o),Q1(a,s);var u=Q1(a,o);for(s=0;s<l.length;s+=2){var c=l[s],f=l[s+1];c==="style"?lL(i,f):c==="dangerouslySetInnerHTML"?sL(i,f):c==="children"?yh(i,f):KO(i,c,f,u)}switch(a){case"input":H1(i,o);break;case"textarea":iL(i,o);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var d=o.value;d!=null?fu(i,!!o.multiple,d,!1):h!==!!o.multiple&&(o.defaultValue!=null?fu(i,!!o.multiple,o.defaultValue,!0):fu(i,!!o.multiple,o.multiple?[]:"",!1))}i[Ah]=o}catch(m){Ot(e,e.return,m)}}break;case 6:if(ti(t,e),Si(e),r&4){if(e.stateNode===null)throw Error(Z(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(m){Ot(e,e.return,m)}}break;case 3:if(ti(t,e),Si(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{wh(t.containerInfo)}catch(m){Ot(e,e.return,m)}break;case 4:ti(t,e),Si(e);break;case 13:ti(t,e),Si(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(AC=_t())),r&4&&dT(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(yn=(u=yn)||c,ti(t,e),yn=u):ti(t,e),Si(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(ae=e,c=e.child;c!==null;){for(f=ae=c;ae!==null;){switch(h=ae,d=h.child,h.tag){case 0:case 11:case 14:case 15:Kf(4,h,h.return);break;case 1:Zl(h,h.return);var p=h.stateNode;if(typeof p.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,p.props=t.memoizedProps,p.state=t.memoizedState,p.componentWillUnmount()}catch(m){Ot(r,n,m)}}break;case 5:Zl(h,h.return);break;case 22:if(h.memoizedState!==null){mT(f);continue}}d!==null?(d.return=h,ae=d):mT(f)}c=c.sibling}e:for(c=null,f=e;;){if(f.tag===5){if(c===null){c=f;try{i=f.stateNode,u?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(a=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=aL("display",s))}catch(m){Ot(e,e.return,m)}}}else if(f.tag===6){if(c===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(m){Ot(e,e.return,m)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;c===f&&(c=null),f=f.return}c===f&&(c=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:ti(t,e),Si(e),r&4&&dT(e);break;case 21:break;default:ti(t,e),Si(e)}}function Si(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(I$(n)){var r=n;break e}n=n.return}throw Error(Z(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(yh(i,""),r.flags&=-33);var o=hT(e);Cw(e,o,i);break;case 3:case 4:var s=r.stateNode.containerInfo,a=hT(e);Ow(e,a,s);break;default:throw Error(Z(161))}}catch(l){Ot(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function S7(e,t,n){ae=e,D$(e)}function D$(e,t,n){for(var r=(e.mode&1)!==0;ae!==null;){var i=ae,o=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||_p;if(!s){var a=i.alternate,l=a!==null&&a.memoizedState!==null||yn;a=_p;var u=yn;if(_p=s,(yn=l)&&!u)for(ae=i;ae!==null;)s=ae,l=s.child,s.tag===22&&s.memoizedState!==null?gT(i):l!==null?(l.return=s,ae=l):gT(i);for(;o!==null;)ae=o,D$(o),o=o.sibling;ae=i,_p=a,yn=u}pT(e)}else i.subtreeFlags&8772&&o!==null?(o.return=i,ae=o):pT(e)}}function pT(e){for(;ae!==null;){var t=ae;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:yn||Fv(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!yn)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:ri(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&ZE(t,o,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}ZE(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var f=c.dehydrated;f!==null&&wh(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Z(163))}yn||t.flags&512&&kw(t)}catch(h){Ot(t,t.return,h)}}if(t===e){ae=null;break}if(n=t.sibling,n!==null){n.return=t.return,ae=n;break}ae=t.return}}function mT(e){for(;ae!==null;){var t=ae;if(t===e){ae=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ae=n;break}ae=t.return}}function gT(e){for(;ae!==null;){var t=ae;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Fv(4,t)}catch(l){Ot(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){Ot(t,i,l)}}var o=t.return;try{kw(t)}catch(l){Ot(t,o,l)}break;case 5:var s=t.return;try{kw(t)}catch(l){Ot(t,s,l)}}}catch(l){Ot(t,t.return,l)}if(t===e){ae=null;break}var a=t.sibling;if(a!==null){a.return=t.return,ae=a;break}ae=t.return}}var k7=Math.ceil,Eg=Lo.ReactCurrentDispatcher,OC=Lo.ReactCurrentOwner,Hr=Lo.ReactCurrentBatchConfig,De=0,en=null,Rt=null,un=0,dr=0,Jl=Bs(0),Vt=0,Mh=null,qa=0,zv=0,CC=0,Gf=null,Fn=null,AC=0,$u=1/0,io=null,Tg=!1,Aw=null,gs=null,jp=!1,rs=null,_g=0,Qf=0,Pw=null,Wm=-1,Um=0;function Rn(){return De&6?_t():Wm!==-1?Wm:Wm=_t()}function ys(e){return e.mode&1?De&2&&un!==0?un&-un:s7.transition!==null?(Um===0&&(Um=xL()),Um):(e=Ve,e!==0||(e=window.event,e=e===void 0?16:PL(e.type)),e):1}function pi(e,t,n,r){if(50<Qf)throw Qf=0,Pw=null,Error(Z(185));qd(e,n,r),(!(De&2)||e!==en)&&(e===en&&(!(De&2)&&(zv|=n),Vt===4&&Jo(e,un)),Zn(e,r),n===1&&De===0&&!(t.mode&1)&&($u=_t()+500,Lv&&Fs()))}function Zn(e,t){var n=e.callbackNode;sH(e,t);var r=dg(e,e===en?un:0);if(r===0)n!==null&&CE(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&CE(n),t===1)e.tag===0?o7(yT.bind(null,e)):qL(yT.bind(null,e)),t7(function(){!(De&6)&&Fs()}),n=null;else{switch(wL(r)){case 1:n=ZO;break;case 4:n=vL;break;case 16:n=hg;break;case 536870912:n=bL;break;default:n=hg}n=H$(n,L$.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function L$(e,t){if(Wm=-1,Um=0,De&6)throw Error(Z(327));var n=e.callbackNode;if(gu()&&e.callbackNode!==n)return null;var r=dg(e,e===en?un:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=jg(e,r);else{t=r;var i=De;De|=2;var o=B$();(en!==e||un!==t)&&(io=null,$u=_t()+500,_a(e,t));do try{A7();break}catch(a){$$(e,a)}while(!0);fC(),Eg.current=o,De=i,Rt!==null?t=0:(en=null,un=0,t=Vt)}if(t!==0){if(t===2&&(i=ew(e),i!==0&&(r=i,t=Ew(e,i))),t===1)throw n=Mh,_a(e,0),Jo(e,r),Zn(e,_t()),n;if(t===6)Jo(e,r);else{if(i=e.current.alternate,!(r&30)&&!O7(i)&&(t=jg(e,r),t===2&&(o=ew(e),o!==0&&(r=o,t=Ew(e,o))),t===1))throw n=Mh,_a(e,0),Jo(e,r),Zn(e,_t()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(Z(345));case 2:aa(e,Fn,io);break;case 3:if(Jo(e,r),(r&130023424)===r&&(t=AC+500-_t(),10<t)){if(dg(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Rn(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=lw(aa.bind(null,e,Fn,io),t);break}aa(e,Fn,io);break;case 4:if(Jo(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-di(r);o=1<<s,s=t[s],s>i&&(i=s),r&=~o}if(r=i,r=_t()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*k7(r/1960))-r,10<r){e.timeoutHandle=lw(aa.bind(null,e,Fn,io),r);break}aa(e,Fn,io);break;case 5:aa(e,Fn,io);break;default:throw Error(Z(329))}}}return Zn(e,_t()),e.callbackNode===n?L$.bind(null,e):null}function Ew(e,t){var n=Gf;return e.current.memoizedState.isDehydrated&&(_a(e,t).flags|=256),e=jg(e,t),e!==2&&(t=Fn,Fn=n,t!==null&&Tw(t)),e}function Tw(e){Fn===null?Fn=e:Fn.push.apply(Fn,e)}function O7(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!mi(o(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Jo(e,t){for(t&=~CC,t&=~zv,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-di(t),r=1<<n;e[n]=-1,t&=~r}}function yT(e){if(De&6)throw Error(Z(327));gu();var t=dg(e,0);if(!(t&1))return Zn(e,_t()),null;var n=jg(e,t);if(e.tag!==0&&n===2){var r=ew(e);r!==0&&(t=r,n=Ew(e,r))}if(n===1)throw n=Mh,_a(e,0),Jo(e,t),Zn(e,_t()),n;if(n===6)throw Error(Z(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,aa(e,Fn,io),Zn(e,_t()),null}function PC(e,t){var n=De;De|=1;try{return e(t)}finally{De=n,De===0&&($u=_t()+500,Lv&&Fs())}}function Ka(e){rs!==null&&rs.tag===0&&!(De&6)&&gu();var t=De;De|=1;var n=Hr.transition,r=Ve;try{if(Hr.transition=null,Ve=1,e)return e()}finally{Ve=r,Hr.transition=n,De=t,!(De&6)&&Fs()}}function EC(){dr=Jl.current,ht(Jl)}function _a(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,e7(n)),Rt!==null)for(n=Rt.return;n!==null;){var r=n;switch(lC(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&vg();break;case 3:Du(),ht(Xn),ht(bn),yC();break;case 5:gC(r);break;case 4:Du();break;case 13:ht(bt);break;case 19:ht(bt);break;case 10:hC(r.type._context);break;case 22:case 23:EC()}n=n.return}if(en=e,Rt=e=vs(e.current,null),un=dr=t,Vt=0,Mh=null,CC=zv=qa=0,Fn=Gf=null,va!==null){for(t=0;t<va.length;t++)if(n=va[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var s=o.next;o.next=i,r.next=s}n.pending=r}va=null}return e}function $$(e,t){do{var n=Rt;try{if(fC(),Bm.current=Pg,Ag){for(var r=xt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Ag=!1}if(Va=0,Xt=Ft=xt=null,qf=!1,Th=0,OC.current=null,n===null||n.return===null){Vt=1,Mh=t,Rt=null;break}e:{var o=e,s=n.return,a=n,l=t;if(t=un,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=a,f=c.tag;if(!(c.mode&1)&&(f===0||f===11||f===15)){var h=c.alternate;h?(c.updateQueue=h.updateQueue,c.memoizedState=h.memoizedState,c.lanes=h.lanes):(c.updateQueue=null,c.memoizedState=null)}var d=iT(s);if(d!==null){d.flags&=-257,oT(d,s,a,o,t),d.mode&1&&rT(o,u,t),t=d,l=u;var p=t.updateQueue;if(p===null){var m=new Set;m.add(l),t.updateQueue=m}else p.add(l);break e}else{if(!(t&1)){rT(o,u,t),TC();break e}l=Error(Z(426))}}else if(mt&&a.mode&1){var v=iT(s);if(v!==null){!(v.flags&65536)&&(v.flags|=256),oT(v,s,a,o,t),uC(Lu(l,a));break e}}o=l=Lu(l,a),Vt!==4&&(Vt=2),Gf===null?Gf=[o]:Gf.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var b=w$(o,l,t);YE(o,b);break e;case 1:a=l;var y=o.type,x=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(gs===null||!gs.has(x)))){o.flags|=65536,t&=-t,o.lanes|=t;var k=S$(o,a,t);YE(o,k);break e}}o=o.return}while(o!==null)}z$(n)}catch(w){t=w,Rt===n&&n!==null&&(Rt=n=n.return);continue}break}while(!0)}function B$(){var e=Eg.current;return Eg.current=Pg,e===null?Pg:e}function TC(){(Vt===0||Vt===3||Vt===2)&&(Vt=4),en===null||!(qa&268435455)&&!(zv&268435455)||Jo(en,un)}function jg(e,t){var n=De;De|=2;var r=B$();(en!==e||un!==t)&&(io=null,_a(e,t));do try{C7();break}catch(i){$$(e,i)}while(!0);if(fC(),De=n,Eg.current=r,Rt!==null)throw Error(Z(261));return en=null,un=0,Vt}function C7(){for(;Rt!==null;)F$(Rt)}function A7(){for(;Rt!==null&&!YU();)F$(Rt)}function F$(e){var t=U$(e.alternate,e,dr);e.memoizedProps=e.pendingProps,t===null?z$(e):Rt=t,OC.current=null}function z$(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=b7(n,t),n!==null){n.flags&=32767,Rt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Vt=6,Rt=null;return}}else if(n=v7(n,t,dr),n!==null){Rt=n;return}if(t=t.sibling,t!==null){Rt=t;return}Rt=t=e}while(t!==null);Vt===0&&(Vt=5)}function aa(e,t,n){var r=Ve,i=Hr.transition;try{Hr.transition=null,Ve=1,P7(e,t,n,r)}finally{Hr.transition=i,Ve=r}return null}function P7(e,t,n,r){do gu();while(rs!==null);if(De&6)throw Error(Z(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(Z(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(aH(e,o),e===en&&(Rt=en=null,un=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||jp||(jp=!0,H$(hg,function(){return gu(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=Hr.transition,Hr.transition=null;var s=Ve;Ve=1;var a=De;De|=4,OC.current=null,w7(e,n),R$(n,e),KH(sw),pg=!!ow,sw=ow=null,e.current=n,S7(n),ZU(),De=a,Ve=s,Hr.transition=o}else e.current=n;if(jp&&(jp=!1,rs=e,_g=i),o=e.pendingLanes,o===0&&(gs=null),tH(n.stateNode),Zn(e,_t()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Tg)throw Tg=!1,e=Aw,Aw=null,e;return _g&1&&e.tag!==0&&gu(),o=e.pendingLanes,o&1?e===Pw?Qf++:(Qf=0,Pw=e):Qf=0,Fs(),null}function gu(){if(rs!==null){var e=wL(_g),t=Hr.transition,n=Ve;try{if(Hr.transition=null,Ve=16>e?16:e,rs===null)var r=!1;else{if(e=rs,rs=null,_g=0,De&6)throw Error(Z(331));var i=De;for(De|=4,ae=e.current;ae!==null;){var o=ae,s=o.child;if(ae.flags&16){var a=o.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(ae=u;ae!==null;){var c=ae;switch(c.tag){case 0:case 11:case 15:Kf(8,c,o)}var f=c.child;if(f!==null)f.return=c,ae=f;else for(;ae!==null;){c=ae;var h=c.sibling,d=c.return;if(M$(c),c===u){ae=null;break}if(h!==null){h.return=d,ae=h;break}ae=d}}}var p=o.alternate;if(p!==null){var m=p.child;if(m!==null){p.child=null;do{var v=m.sibling;m.sibling=null,m=v}while(m!==null)}}ae=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,ae=s;else e:for(;ae!==null;){if(o=ae,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Kf(9,o,o.return)}var b=o.sibling;if(b!==null){b.return=o.return,ae=b;break e}ae=o.return}}var y=e.current;for(ae=y;ae!==null;){s=ae;var x=s.child;if(s.subtreeFlags&2064&&x!==null)x.return=s,ae=x;else e:for(s=y;ae!==null;){if(a=ae,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Fv(9,a)}}catch(w){Ot(a,a.return,w)}if(a===s){ae=null;break e}var k=a.sibling;if(k!==null){k.return=a.return,ae=k;break e}ae=a.return}}if(De=i,Fs(),Fi&&typeof Fi.onPostCommitFiberRoot=="function")try{Fi.onPostCommitFiberRoot(Mv,e)}catch{}r=!0}return r}finally{Ve=n,Hr.transition=t}}return!1}function vT(e,t,n){t=Lu(n,t),t=w$(e,t,1),e=ms(e,t,1),t=Rn(),e!==null&&(qd(e,1,t),Zn(e,t))}function Ot(e,t,n){if(e.tag===3)vT(e,e,n);else for(;t!==null;){if(t.tag===3){vT(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(gs===null||!gs.has(r))){e=Lu(n,e),e=S$(t,e,1),t=ms(t,e,1),e=Rn(),t!==null&&(qd(t,1,e),Zn(t,e));break}}t=t.return}}function E7(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Rn(),e.pingedLanes|=e.suspendedLanes&n,en===e&&(un&n)===n&&(Vt===4||Vt===3&&(un&130023424)===un&&500>_t()-AC?_a(e,0):CC|=n),Zn(e,t)}function W$(e,t){t===0&&(e.mode&1?(t=wp,wp<<=1,!(wp&130023424)&&(wp=4194304)):t=1);var n=Rn();e=Po(e,t),e!==null&&(qd(e,t,n),Zn(e,n))}function T7(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),W$(e,n)}function _7(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Z(314))}r!==null&&r.delete(t),W$(e,n)}var U$;U$=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Xn.current)Hn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Hn=!1,y7(e,t,n);Hn=!!(e.flags&131072)}else Hn=!1,mt&&t.flags&1048576&&KL(t,wg,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;zm(e,t),e=t.pendingProps;var i=Iu(t,bn.current);mu(t,n),i=bC(null,t,r,e,i,n);var o=xC();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Yn(r)?(o=!0,bg(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,pC(t),i.updater=Bv,t.stateNode=i,i._reactInternals=t,mw(t,r,e,n),t=vw(null,t,r,!0,o,n)):(t.tag=0,mt&&o&&aC(t),An(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(zm(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=M7(r),e=ri(r,e),i){case 0:t=yw(null,t,r,e,n);break e;case 1:t=lT(null,t,r,e,n);break e;case 11:t=sT(null,t,r,e,n);break e;case 14:t=aT(null,t,r,ri(r.type,e),n);break e}throw Error(Z(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ri(r,i),yw(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ri(r,i),lT(e,t,r,i,n);case 3:e:{if(A$(t),e===null)throw Error(Z(387));r=t.pendingProps,o=t.memoizedState,i=o.element,JL(e,t),Og(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=Lu(Error(Z(423)),t),t=uT(e,t,r,n,i);break e}else if(r!==i){i=Lu(Error(Z(424)),t),t=uT(e,t,r,n,i);break e}else for(br=ps(t.stateNode.containerInfo.firstChild),Sr=t,mt=!0,li=null,n=YL(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Nu(),r===i){t=Eo(e,t,n);break e}An(e,t,r,n)}t=t.child}return t;case 5:return e$(t),e===null&&hw(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,aw(r,i)?s=null:o!==null&&aw(r,o)&&(t.flags|=32),C$(e,t),An(e,t,s,n),t.child;case 6:return e===null&&hw(t),null;case 13:return P$(e,t,n);case 4:return mC(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ru(t,null,r,n):An(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ri(r,i),sT(e,t,r,i,n);case 7:return An(e,t,t.pendingProps,n),t.child;case 8:return An(e,t,t.pendingProps.children,n),t.child;case 12:return An(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,it(Sg,r._currentValue),r._currentValue=s,o!==null)if(mi(o.value,s)){if(o.children===i.children&&!Xn.current){t=Eo(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=yo(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),dw(o.return,n,t),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(Z(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),dw(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}An(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,mu(t,n),i=qr(i),r=r(i),t.flags|=1,An(e,t,r,n),t.child;case 14:return r=t.type,i=ri(r,t.pendingProps),i=ri(r.type,i),aT(e,t,r,i,n);case 15:return k$(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ri(r,i),zm(e,t),t.tag=1,Yn(r)?(e=!0,bg(t)):e=!1,mu(t,n),x$(t,r,i),mw(t,r,i,n),vw(null,t,r,!0,e,n);case 19:return E$(e,t,n);case 22:return O$(e,t,n)}throw Error(Z(156,t.tag))};function H$(e,t){return yL(e,t)}function j7(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Br(e,t,n,r){return new j7(e,t,n,r)}function _C(e){return e=e.prototype,!(!e||!e.isReactComponent)}function M7(e){if(typeof e=="function")return _C(e)?1:0;if(e!=null){if(e=e.$$typeof,e===QO)return 11;if(e===XO)return 14}return 2}function vs(e,t){var n=e.alternate;return n===null?(n=Br(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Hm(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")_C(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Ul:return ja(n.children,i,o,t);case GO:s=8,i|=8;break;case B1:return e=Br(12,n,t,i|2),e.elementType=B1,e.lanes=o,e;case F1:return e=Br(13,n,t,i),e.elementType=F1,e.lanes=o,e;case z1:return e=Br(19,n,t,i),e.elementType=z1,e.lanes=o,e;case eL:return Wv(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ZD:s=10;break e;case JD:s=9;break e;case QO:s=11;break e;case XO:s=14;break e;case qo:s=16,r=null;break e}throw Error(Z(130,e==null?e:typeof e,""))}return t=Br(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function ja(e,t,n,r){return e=Br(7,e,r,t),e.lanes=n,e}function Wv(e,t,n,r){return e=Br(22,e,r,t),e.elementType=eL,e.lanes=n,e.stateNode={isHidden:!1},e}function qb(e,t,n){return e=Br(6,e,null,t),e.lanes=n,e}function Kb(e,t,n){return t=Br(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function I7(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Pb(0),this.expirationTimes=Pb(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pb(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function jC(e,t,n,r,i,o,s,a,l){return e=new I7(e,t,n,a,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Br(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},pC(o),e}function N7(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Wl,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function V$(e){if(!e)return As;e=e._reactInternals;e:{if(al(e)!==e||e.tag!==1)throw Error(Z(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Yn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Z(171))}if(e.tag===1){var n=e.type;if(Yn(n))return VL(e,n,t)}return t}function q$(e,t,n,r,i,o,s,a,l){return e=jC(n,r,!0,e,i,o,s,a,l),e.context=V$(null),n=e.current,r=Rn(),i=ys(n),o=yo(r,i),o.callback=t??null,ms(n,o,i),e.current.lanes=i,qd(e,i,r),Zn(e,r),e}function Uv(e,t,n,r){var i=t.current,o=Rn(),s=ys(i);return n=V$(n),t.context===null?t.context=n:t.pendingContext=n,t=yo(o,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ms(i,t,s),e!==null&&(pi(e,i,s,o),$m(e,i,s)),s}function Mg(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function bT(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function MC(e,t){bT(e,t),(e=e.alternate)&&bT(e,t)}function R7(){return null}var K$=typeof reportError=="function"?reportError:function(e){console.error(e)};function IC(e){this._internalRoot=e}Hv.prototype.render=IC.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Z(409));Uv(e,t,null,null)};Hv.prototype.unmount=IC.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ka(function(){Uv(null,e,null,null)}),t[Ao]=null}};function Hv(e){this._internalRoot=e}Hv.prototype.unstable_scheduleHydration=function(e){if(e){var t=OL();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Zo.length&&t!==0&&t<Zo[n].priority;n++);Zo.splice(n,0,e),n===0&&AL(e)}};function NC(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Vv(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function xT(){}function D7(e,t,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var u=Mg(s);o.call(u)}}var s=q$(t,r,e,0,null,!1,!1,"",xT);return e._reactRootContainer=s,e[Ao]=s.current,Oh(e.nodeType===8?e.parentNode:e),Ka(),s}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var u=Mg(l);a.call(u)}}var l=jC(e,0,!1,null,null,!1,!1,"",xT);return e._reactRootContainer=l,e[Ao]=l.current,Oh(e.nodeType===8?e.parentNode:e),Ka(function(){Uv(t,l,n,r)}),l}function qv(e,t,n,r,i){var o=n._reactRootContainer;if(o){var s=o;if(typeof i=="function"){var a=i;i=function(){var l=Mg(s);a.call(l)}}Uv(t,s,e,i)}else s=D7(n,t,e,i,r);return Mg(s)}SL=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=If(t.pendingLanes);n!==0&&(JO(t,n|1),Zn(t,_t()),!(De&6)&&($u=_t()+500,Fs()))}break;case 13:Ka(function(){var r=Po(e,1);if(r!==null){var i=Rn();pi(r,e,1,i)}}),MC(e,1)}};eC=function(e){if(e.tag===13){var t=Po(e,134217728);if(t!==null){var n=Rn();pi(t,e,134217728,n)}MC(e,134217728)}};kL=function(e){if(e.tag===13){var t=ys(e),n=Po(e,t);if(n!==null){var r=Rn();pi(n,e,t,r)}MC(e,t)}};OL=function(){return Ve};CL=function(e,t){var n=Ve;try{return Ve=e,t()}finally{Ve=n}};Y1=function(e,t,n){switch(t){case"input":if(H1(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=Dv(r);if(!i)throw Error(Z(90));nL(r),H1(r,i)}}}break;case"textarea":iL(e,n);break;case"select":t=n.value,t!=null&&fu(e,!!n.multiple,t,!1)}};fL=PC;hL=Ka;var L7={usingClientEntryPoint:!1,Events:[Gd,Kl,Dv,uL,cL,PC]},of={findFiberByHostInstance:ya,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},$7={bundleType:of.bundleType,version:of.version,rendererPackageName:of.rendererPackageName,rendererConfig:of.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Lo.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=mL(e),e===null?null:e.stateNode},findFiberByHostInstance:of.findFiberByHostInstance||R7,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Mp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Mp.isDisabled&&Mp.supportsFiber)try{Mv=Mp.inject($7),Fi=Mp}catch{}}Pr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=L7;Pr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!NC(t))throw Error(Z(200));return N7(e,t,null,n)};Pr.createRoot=function(e,t){if(!NC(e))throw Error(Z(299));var n=!1,r="",i=K$;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=jC(e,1,!1,null,null,n,!1,r,i),e[Ao]=t.current,Oh(e.nodeType===8?e.parentNode:e),new IC(t)};Pr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Z(188)):(e=Object.keys(e).join(","),Error(Z(268,e)));return e=mL(t),e=e===null?null:e.stateNode,e};Pr.flushSync=function(e){return Ka(e)};Pr.hydrate=function(e,t,n){if(!Vv(t))throw Error(Z(200));return qv(null,e,t,!0,n)};Pr.hydrateRoot=function(e,t,n){if(!NC(e))throw Error(Z(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",s=K$;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=q$(t,null,e,1,n??null,i,!1,o,s),e[Ao]=t.current,Oh(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new Hv(t)};Pr.render=function(e,t,n){if(!Vv(t))throw Error(Z(200));return qv(null,e,t,!1,n)};Pr.unmountComponentAtNode=function(e){if(!Vv(e))throw Error(Z(40));return e._reactRootContainer?(Ka(function(){qv(null,null,e,!1,function(){e._reactRootContainer=null,e[Ao]=null})}),!0):!1};Pr.unstable_batchedUpdates=PC;Pr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Vv(n))throw Error(Z(200));if(e==null||e._reactInternals===void 0)throw Error(Z(38));return qv(e,t,n,!1,r)};Pr.version="18.3.1-next-f1338f8080-20240426";function G$(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(G$)}catch(e){console.error(e)}}G$(),GD.exports=Pr;var ll=GD.exports;const B7=ze(ll);var _w,wT=ll;_w=wT.createRoot,wT.hydrateRoot;var Ac=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},F7=class extends Ac{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},RC=new F7,z7={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},W7=class{#e=z7;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},xa=new W7;function U7(e){setTimeout(e,0)}var H7=typeof window>"u"||"Deno"in globalThis;function Pn(){}function V7(e,t){return typeof e=="function"?e(t):e}function jw(e){return typeof e=="number"&&e>=0&&e!==1/0}function Q$(e,t){return Math.max(e+(t||0)-Date.now(),0)}function bs(e,t){return typeof e=="function"?e(t):e}function gr(e,t){return typeof e=="function"?e(t):e}function ST(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==DC(s,t.options))return!1}else if(!Ih(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||o&&!o(t))}function kT(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Ga(t.options.mutationKey)!==Ga(o))return!1}else if(!Ih(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function DC(e,t){return(t?.queryKeyHashFn||Ga)(e)}function Ga(e){return JSON.stringify(e,(t,n)=>Mw(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Ih(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Ih(e[n],t[n])):!1}var q7=Object.prototype.hasOwnProperty;function X$(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=OT(e)&&OT(t);if(!r&&!(Mw(e)&&Mw(t)))return t;const o=(r?e:Object.keys(e)).length,s=r?t:Object.keys(t),a=s.length,l=r?new Array(a):{};let u=0;for(let c=0;c<a;c++){const f=r?c:s[c],h=e[f],d=t[f];if(h===d){l[f]=h,(r?c<o:q7.call(e,f))&&u++;continue}if(h===null||d===null||typeof h!="object"||typeof d!="object"){l[f]=d;continue}const p=X$(h,d,n+1);l[f]=p,p===h&&u++}return o===a&&u===o?e:l}function Ig(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function OT(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Mw(e){if(!CT(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!CT(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function CT(e){return Object.prototype.toString.call(e)==="[object Object]"}function K7(e){return new Promise(t=>{xa.setTimeout(t,e)})}function Iw(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?X$(e,t):t}function G7(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Q7(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var LC=Symbol();function Y$(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===LC?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function $C(e,t){return typeof e=="function"?e(...t):!!e}function X7(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var Nh=(()=>{let e=()=>H7;return{isServer(){return e()},setIsServer(t){e=t}}})();function Nw(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var Y7=U7;function Z7(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=Y7;const o=a=>{t?e.push(a):i(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{o(()=>{a(...l)})},schedule:o,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var Wt=Z7(),J7=class extends Ac{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},Ng=new J7;function eV(e){return Math.min(1e3*2**e,3e4)}function Z$(e){return(e??"online")==="online"?Ng.isOnline():!0}var Rw=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function J$(e){let t=!1,n=0,r;const i=Nw(),o=()=>i.status!=="pending",s=m=>{if(!o()){const v=new Rw(m);h(v),e.onCancel?.(v)}},a=()=>{t=!0},l=()=>{t=!1},u=()=>RC.isFocused()&&(e.networkMode==="always"||Ng.isOnline())&&e.canRun(),c=()=>Z$(e.networkMode)&&e.canRun(),f=m=>{o()||(r?.(),i.resolve(m))},h=m=>{o()||(r?.(),i.reject(m))},d=()=>new Promise(m=>{r=v=>{(o()||u())&&m(v)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),p=()=>{if(o())return;let m;const v=n===0?e.initialPromise:void 0;try{m=v??e.fn()}catch(b){m=Promise.reject(b)}Promise.resolve(m).then(f).catch(b=>{if(o())return;const y=e.retry??(Nh.isServer()?0:3),x=e.retryDelay??eV,k=typeof x=="function"?x(n,b):x,w=y===!0||typeof y=="number"&&n<y||typeof y=="function"&&y(n,b);if(t||!w){h(b);return}n++,e.onFail?.(n,b),K7(k).then(()=>u()?void 0:d()).then(()=>{t?h(b):p()})})};return{promise:i,status:()=>i.status,cancel:s,continue:()=>(r?.(),i),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?p():d().then(p),i)}}var eB=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),jw(this.gcTime)&&(this.#e=xa.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Nh.isServer()?1/0:5*60*1e3))}clearGcTimeout(){this.#e!==void 0&&(xa.clearTimeout(this.#e),this.#e=void 0)}};function tV(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],s=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let c=!1;const f=p=>{X7(p,()=>t.signal,()=>c=!0)},h=Y$(t.options,t.fetchOptions),d=async(p,m,v)=>{if(c)return Promise.reject(t.signal.reason);if(m==null&&p.pages.length)return Promise.resolve(p);const y=(()=>{const S={client:t.client,queryKey:t.queryKey,pageParam:m,direction:v?"backward":"forward",meta:t.options.meta};return f(S),S})(),x=await h(y),{maxPages:k}=t.options,w=v?Q7:G7;return{pages:w(p.pages,x,k),pageParams:w(p.pageParams,m,k)}};if(i&&o.length){const p=i==="backward",m=p?nV:AT,v={pages:o,pageParams:s},b=m(r,v);a=await d(v,b,p)}else{const p=e??o.length;do{const m=l===0?s[0]??r.initialPageParam:AT(r,a);if(l>0&&m==null)break;a=await d(a,m),l++}while(l<p)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=u}}}function AT(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function nV(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var rV=class extends eB{#e;#t;#n;#r;#o;#i;#a;#s;constructor(e){super(),this.#s=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#o=e.client,this.#r=this.#o.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=ET(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=ET(this.options);t.data!==void 0&&(this.setState(PT(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const n=Iw(this.state.data,e,this.options);return this.#l({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:"setState",state:e})}cancel(e){const t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(Pn).catch(Pn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>gr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===LC||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>bs(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Q$(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#s||this.#c()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(u=>u.options.queryFn);l&&this.setOptions(l.options)}const n=new AbortController,r=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{const l=Y$(this.options,t),c=(()=>{const f={client:this.#o,queryKey:this.queryKey,meta:this.meta};return r(f),f})();return this.#s=!1,this.options.persister?this.options.persister(l,c,this):l(c)},s=(()=>{const l={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:i};return r(l),l})();(this.#e==="infinite"?tV(this.options.pages):this.options.behavior)?.onFetch(s,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==s.fetchOptions?.meta)&&this.#l({type:"fetch",meta:s.fetchOptions?.meta}),this.#i=J$({initialPromise:t?.initialPromise,fn:s.fetchFn,onCancel:l=>{l instanceof Rw&&l.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(l,u)=>{this.#l({type:"failed",failureCount:l,error:u})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0});try{const l=await this.#i.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#r.config.onSuccess?.(l,this),this.#r.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof Rw){if(l.silent)return this.#i.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#l({type:"error",error:l}),this.#r.config.onError?.(l,this),this.#r.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#l(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...tB(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...PT(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?r:void 0,r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Wt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function tB(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Z$(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function PT(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ET(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var iV=class extends Ac{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#a=Nw(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#o;#i;#a;#s;#c;#l;#p;#f;#h;#u;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),TT(this.#t,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Dw(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Dw(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof gr(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Ig(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&_T(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#t!==n||gr(this.options.enabled,this.#t)!==gr(t.enabled,this.#t)||bs(this.options.staleTime,this.#t)!==bs(t.staleTime,this.#t))&&this.#g();const i=this.#y();r&&(this.#t!==n||gr(this.options.enabled,this.#t)!==gr(t.enabled,this.#t)||i!==this.#u)&&this.#v(i)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return sV(this,n)&&(this.#r=n,this.#i=this.options,this.#o=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#d(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Pn)),t}#g(){this.#x();const e=bs(this.options.staleTime,this.#t);if(Nh.isServer()||this.#r.isStale||!jw(e))return;const n=Q$(this.#r.dataUpdatedAt,e)+1;this.#f=xa.setTimeout(()=>{this.#r.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#u=e,!(Nh.isServer()||gr(this.options.enabled,this.#t)===!1||!jw(this.#u)||this.#u===0)&&(this.#h=xa.setInterval(()=>{(this.options.refetchIntervalInBackground||RC.isFocused())&&this.#d()},this.#u))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#f!==void 0&&(xa.clearTimeout(this.#f),this.#f=void 0)}#w(){this.#h!==void 0&&(xa.clearInterval(this.#h),this.#h=void 0)}createResult(e,t){const n=this.#t,r=this.options,i=this.#r,o=this.#o,s=this.#i,l=e!==n?e.state:this.#n,{state:u}=e;let c={...u},f=!1,h;if(t._optimisticResults){const A=this.hasListeners(),P=!A&&TT(e,t),M=A&&_T(e,n,t,r);(P||M)&&(c={...c,...tB(u.data,e.options)}),t._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:d,errorUpdatedAt:p,status:m}=c;h=c.data;let v=!1;if(t.placeholderData!==void 0&&h===void 0&&m==="pending"){let A;i?.isPlaceholderData&&t.placeholderData===s?.placeholderData?(A=i.data,v=!0):A=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,A!==void 0&&(m="success",h=Iw(i?.data,A,t),f=!0)}if(t.select&&h!==void 0&&!v)if(i&&h===o?.data&&t.select===this.#c)h=this.#l;else try{this.#c=t.select,h=t.select(h),h=Iw(i?.data,h,t),this.#l=h,this.#s=null}catch(A){this.#s=A}this.#s&&(d=this.#s,h=this.#l,p=Date.now(),m="error");const b=c.fetchStatus==="fetching",y=m==="pending",x=m==="error",k=y&&b,w=h!==void 0,O={status:m,fetchStatus:c.fetchStatus,isPending:y,isSuccess:m==="success",isError:x,isInitialLoading:k,isLoading:k,data:h,dataUpdatedAt:c.dataUpdatedAt,error:d,errorUpdatedAt:p,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:c.dataUpdateCount>l.dataUpdateCount||c.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!y,isLoadingError:x&&!w,isPaused:c.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:x&&w,isStale:BC(e,t),refetch:this.refetch,promise:this.#a,isEnabled:gr(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const A=O.data!==void 0,P=O.status==="error"&&!A,M=D=>{P?D.reject(O.error):A&&D.resolve(O.data)},j=()=>{const D=this.#a=O.promise=Nw();M(D)},E=this.#a;switch(E.status){case"pending":e.queryHash===n.queryHash&&M(E);break;case"fulfilled":(P||O.data!==E.value)&&j();break;case"rejected":(!P||O.error!==E.reason)&&j();break}}return O}updateResult(){const e=this.#r,t=this.createResult(this.#t,this.options);if(this.#o=this.#t.state,this.#i=this.options,this.#o.data!==void 0&&(this.#p=this.#t),Ig(t,e))return;this.#r=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#m.size)return!0;const o=new Set(i??this.#m);return this.options.throwOnError&&o.add("error"),Object.keys(this.#r).some(s=>{const a=s;return this.#r[a]!==e[a]&&o.has(a)})};this.#k({listeners:n()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#k(e){Wt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function oV(e,t){return gr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&gr(t.retryOnMount,e)===!1)}function TT(e,t){return oV(e,t)||e.state.data!==void 0&&Dw(e,t,t.refetchOnMount)}function Dw(e,t,n){if(gr(t.enabled,e)!==!1&&bs(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&BC(e,t)}return!1}function _T(e,t,n,r){return(e!==t||gr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&BC(e,n)}function BC(e,t){return gr(t.enabled,e)!==!1&&e.isStaleByTime(bs(t.staleTime,e))}function sV(e,t){return!Ig(e.getCurrentResult(),t)}var aV=class extends eB{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||nB(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#o({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=J$({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(o,s)=>{this.#o({type:"failed",failureCount:o,error:s})},onPause:()=>{this.#o({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#r.canStart();try{if(r)t();else{this.#o({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const s=await this.options.onMutate?.(e,n);s!==this.state.context&&this.#o({type:"pending",context:s,variables:e,isPaused:i})}const o=await this.#r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#o({type:"success",data:o}),o}catch(o){try{await this.#n.config.onError?.(o,e,this.state.context,this,n)}catch(s){Promise.reject(s)}try{await this.options.onError?.(o,e,this.state.context,n)}catch(s){Promise.reject(s)}try{await this.#n.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,n)}catch(s){Promise.reject(s)}try{await this.options.onSettled?.(void 0,o,e,this.state.context,n)}catch(s){Promise.reject(s)}throw this.#o({type:"error",error:o}),o}finally{this.#n.runNext(this)}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Wt.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function nB(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var lV=class extends Ac{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new aV({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=Ip(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Ip(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Ip(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Ip(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Wt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>kT(t,n))}findAll(e={}){return this.getAll().filter(t=>kT(e,t))}notify(e){Wt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Wt.batch(()=>Promise.all(e.map(t=>t.continue().catch(Pn))))}};function Ip(e){return e.options.scope?.id}var uV=class extends Ac{#e;#t=void 0;#n;#r;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#o()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),Ig(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Ga(n.mutationKey)!==Ga(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#o(),this.#i(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#o(),this.#i()}mutate(t,n){return this.#r=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#o(){const t=this.#n?.state??nB();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#i(t){Wt.batch(()=>{if(this.#r&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#r.onSuccess?.(t.data,n,r,i)}catch(o){Promise.reject(o)}try{this.#r.onSettled?.(t.data,null,n,r,i)}catch(o){Promise.reject(o)}}else if(t?.type==="error"){try{this.#r.onError?.(t.error,n,r,i)}catch(o){Promise.reject(o)}try{this.#r.onSettled?.(void 0,t.error,n,r,i)}catch(o){Promise.reject(o)}}}this.listeners.forEach(n=>{n(this.#t)})})}},cV=class extends Ac{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??DC(r,t);let o=this.get(i);return o||(o=new rV({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Wt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>ST(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>ST(e,n)):t}notify(e){Wt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Wt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Wt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},fV=class{#e;#t;#n;#r;#o;#i;#a;#s;constructor(e={}){this.#e=e.queryCache||new cV,this.#t=e.mutationCache||new lV,this.#n=e.defaultOptions||{},this.#r=new Map,this.#o=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=RC.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Ng.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#a?.(),this.#a=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(bs(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(r.queryHash)?.state.data,s=V7(t,o);if(s!==void 0)return this.#e.build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return Wt.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Wt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Wt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Wt.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Pn).catch(Pn)}invalidateQueries(e,t={}){return Wt.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Wt.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(Pn)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Pn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(bs(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Pn).catch(Pn)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Pn).catch(Pn)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Ng.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Ga(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Ih(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#o.set(Ga(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#o.values()],n={};return t.forEach(r=>{Ih(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=DC(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===LC&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},rB=C.createContext(void 0),yi=e=>{const t=C.useContext(rB);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},hV=({client:e,children:t})=>(C.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),g.jsx(rB.Provider,{value:e,children:t})),iB=C.createContext(!1),dV=()=>C.useContext(iB);iB.Provider;function pV(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var mV=C.createContext(pV()),gV=()=>C.useContext(mV),yV=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?$C(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},vV=e=>{C.useEffect(()=>{e.clearReset()},[e])},bV=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||$C(n,[e.error,r])),xV=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},wV=(e,t)=>e.isLoading&&e.isFetching&&!t,SV=(e,t)=>e?.suspense&&t.isPending,jT=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function kV(e,t,n){const r=dV(),i=gV(),o=yi(),s=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(s);const a=o.getQueryCache().get(s.queryHash);s._optimisticResults=r?"isRestoring":"optimistic",xV(s),yV(s,i,a),vV(i);const l=!o.getQueryCache().get(s.queryHash),[u]=C.useState(()=>new t(o,s)),c=u.getOptimisticResult(s),f=!r&&e.subscribed!==!1;if(C.useSyncExternalStore(C.useCallback(h=>{const d=f?u.subscribe(Wt.batchCalls(h)):Pn;return u.updateResult(),d},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),C.useEffect(()=>{u.setOptions(s)},[s,u]),SV(s,c))throw jT(s,u,i);if(bV({result:c,errorResetBoundary:i,throwOnError:s.throwOnError,query:a,suspense:s.suspense}))throw c.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(s,c),s.experimental_prefetchInRender&&!Nh.isServer()&&wV(c,r)&&(l?jT(s,u,i):a?.promise)?.catch(Pn).finally(()=>{u.updateResult()}),s.notifyOnChangeProps?c:u.trackResult(c)}function wt(e,t){return kV(e,iV)}function Ps(e,t){const n=yi(),[r]=C.useState(()=>new uV(n,e));C.useEffect(()=>{r.setOptions(e)},[r,e]);const i=C.useSyncExternalStore(C.useCallback(s=>r.subscribe(Wt.batchCalls(s)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=C.useCallback((s,a)=>{r.mutate(s,a).catch(Pn)},[r]);if(i.error&&$C(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}var Rf=typeof window<"u"?C.useLayoutEffect:C.useEffect;function Gb(e){const t=C.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function OV(e,t,n={},r={}){C.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([o])=>{t(o)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function CV(e){const t=C.useRef(null);return C.useImperativeHandle(e,()=>t.current,[]),t}const oB=!1;function Rh(e){return e[e.length-1]}function AV(e){return typeof e=="function"}function is(e,t){return AV(e)?e(t):e}const sB=Object.prototype.hasOwnProperty,MT=Object.prototype.propertyIsEnumerable;function aB(e){for(const t in e)if(sB.call(e,t))return!0;return!1}const PV=()=>Object.create(null),ea=(e,t)=>os(e,t,PV);function os(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const i=t,o=RT(e)&&RT(i);if(!o&&!(Bu(e)&&Bu(i)))return i;const s=o?e:IT(e);if(!s)return i;const a=o?i:IT(i);if(!a)return i;const l=s.length,u=a.length,c=o?new Array(u):n();let f=0;for(let h=0;h<u;h++){const d=o?h:a[h],p=e[d],m=i[d];if(p===m){c[d]=p,(o?h<l:sB.call(e,d))&&f++;continue}if(p===null||m===null||typeof p!="object"||typeof m!="object"){c[d]=m;continue}const v=os(p,m,n,r+1);c[d]=v,v===p&&f++}return l===u&&f===l?e:c}function IT(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!MT.call(e,i))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const i of n){if(!MT.call(e,i))return!1;r.push(i)}return r}function Bu(e){if(!NT(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!NT(n)||!n.hasOwnProperty("isPrototypeOf"))}function NT(e){return Object.prototype.toString.call(e)==="[object Object]"}function RT(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ma(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!Ma(e[r],t[r],n))return!1;return!0}if(Bu(e)&&Bu(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const s in t)if((!r||t[s]!==void 0)&&!Ma(e[s],t[s],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(const s in e)e[s]!==void 0&&i++;let o=0;for(const s in t)if((!r||t[s]!==void 0)&&(o++,o>i||!Ma(e[s],t[s],n)))return!1;return i===o}return!1}function Fu(e){let t,n;const r=new Promise((i,o)=>{t=i,n=o});return r.status="pending",r.resolve=i=>{r.status="resolved",r.value=i,t(i),e?.(i)},r.reject=i=>{r.status="rejected",n(i)},r}function Dh(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function EV(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function DT(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return EV(t)}const TV=["http:","https:","mailto:","tel:"];function Rg(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function sf(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",i;for(;(i=t.exec(e))!==null;)r+=DT(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+DT(n?e.slice(n):e);let o=!1;return r.startsWith("//")&&(o=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:o}}function _V(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function jV(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function vo(){throw new Error("Invariant failed")}function Lh(e){const t=new Map;let n,r;const i=o=>{o.next&&(o.prev?(o.prev.next=o.next,o.next.prev=o.prev,o.next=void 0,r&&(r.next=o,o.prev=r)):(o.next.prev=void 0,n=o.next,o.next=void 0,r&&(o.prev=r,r.next=o)),r=o)};return{get(o){const s=t.get(o);if(s)return i(s),s.value},set(o,s){if(t.size>=e&&n){const l=n;t.delete(l.key),l.next&&(n=l.next,l.next.prev=void 0),l===r&&(r=void 0)}const a=t.get(o);if(a)a.value=s,i(a);else{const l={key:o,value:s,prev:r};r&&(r.next=l),r=l,n||(n=l),t.set(o,l)}},clear(){t.clear(),n=void 0,r=void 0}}}const ss=4,lB=5;function MV(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function uB(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),i=r===-1?e.length:r,o=e.substring(t,i);if(!o||!o.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(o==="$"){const a=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=a,n[4]=a,n[5]=a,n}if(o.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const s=MV(o);if(s){const[a,l]=s,u=o.charCodeAt(a+1);if(u===45){if(a+2<o.length&&o.charCodeAt(a+2)===36){const c=a+3,f=l;if(c<f)return n[0]=3,n[1]=t+a,n[2]=t+c,n[3]=t+f,n[4]=t+l+1,n[5]=i,n}}else if(u===36){const c=a+1,f=a+2;return f===l?(n[0]=2,n[1]=t+a,n[2]=t+c,n[3]=t+f,n[4]=t+l+1,n[5]=e.length,n):(n[0]=1,n[1]=t+a,n[2]=t+f,n[3]=t+l,n[4]=t+l+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function Kv(e,t,n,r,i,o,s){s?.(n);let a=r;{const l=n.fullPath??n.from,u=l.length,c=n.options?.caseSensitive??e,f=n.options?.params?.parse??n.options?.parseParams;for(;a<u;){const d=uB(l,a,t);let p;const m=a,v=d[5];switch(a=v+1,o++,d[0]){case 0:{const b=l.substring(d[2],d[3]);if(c){const y=i.static?.get(b);if(y)p=y;else{i.static??=new Map;const x=wa(n.fullPath??n.from);x.parent=i,x.depth=o,p=x,i.static.set(b,x)}}else{const y=b.toLowerCase(),x=i.staticInsensitive?.get(y);if(x)p=x;else{i.staticInsensitive??=new Map;const k=wa(n.fullPath??n.from);k.parent=i,k.depth=o,p=k,i.staticInsensitive.set(y,k)}}break}case 1:{const b=l.substring(m,d[1]),y=l.substring(d[4],v),x=c&&!!(b||y),k=b?x?b:b.toLowerCase():void 0,w=y?x?y:y.toLowerCase():void 0,S=!f&&i.dynamic?.find(O=>!O.parse&&O.caseSensitive===x&&O.prefix===k&&O.suffix===w);if(S)p=S;else{const O=Xb(1,n.fullPath??n.from,x,k,w);p=O,O.depth=o,O.parent=i,i.dynamic??=[],i.dynamic.push(O)}break}case 3:{const b=l.substring(m,d[1]),y=l.substring(d[4],v),x=c&&!!(b||y),k=b?x?b:b.toLowerCase():void 0,w=y?x?y:y.toLowerCase():void 0,S=!f&&i.optional?.find(O=>!O.parse&&O.caseSensitive===x&&O.prefix===k&&O.suffix===w);if(S)p=S;else{const O=Xb(3,n.fullPath??n.from,x,k,w);p=O,O.parent=i,O.depth=o,i.optional??=[],i.optional.push(O)}break}case 2:{const b=l.substring(m,d[1]),y=l.substring(d[4],v),x=c&&!!(b||y),k=b?x?b:b.toLowerCase():void 0,w=y?x?y:y.toLowerCase():void 0,S=Xb(2,n.fullPath??n.from,x,k,w);p=S,S.parent=i,S.depth=o,i.wildcard??=[],i.wildcard.push(S)}}i=p}if(f&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const d=wa(n.fullPath??n.from);d.kind=lB,d.parent=i,o++,d.depth=o,i.pathless??=[],i.pathless.push(d),i=d}const h=(n.path||!n.children)&&!n.isRoot;if(h&&l.endsWith("/")){const d=wa(n.fullPath??n.from);d.kind=ss,d.parent=i,o++,d.depth=o,i.index=d,i=d}i.parse=f??null,h&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const l of n.children)Kv(e,t,l,a,i,o,s)}function Qb(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Go(e){if(e.pathless)for(const t of e.pathless)Go(t);if(e.static)for(const t of e.static.values())Go(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Go(t);if(e.dynamic?.length){e.dynamic.sort(Qb);for(const t of e.dynamic)Go(t)}if(e.optional?.length){e.optional.sort(Qb);for(const t of e.optional)Go(t)}if(e.wildcard?.length){e.wildcard.sort(Qb);for(const t of e.wildcard)Go(t)}}function wa(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null}}function Xb(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,caseSensitive:n,prefix:r,suffix:i}}function IV(e,t){const n=wa("/"),r=new Uint16Array(6);for(const i of e)Kv(!1,r,i,1,n,0);Go(n),t.masksTree=n,t.flatCache=Lh(1e3)}function NV(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=FC(e,t.masksTree);return t.flatCache.set(e,r),r}function RV(e,t,n,r,i){e||="/",r||="/";const o=t?`case\0${e}`:e;let s=i.singleCache.get(o);return s||(s=wa("/"),Kv(t,new Uint16Array(6),{from:e},1,s,0),i.singleCache.set(o,s)),FC(r,s,n)}function DV(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||="/";let o;try{o=FC(e,t.segmentTree,n)}catch(s){if(s instanceof URIError)o=null;else throw s}return o&&(o.branch=fB(o.route)),t.matchCache.set(r,o),o}function LV(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function $V(e,t=!1,n){const r=wa(e.fullPath),i=new Uint16Array(6),o={},s={};let a=0;return Kv(t,i,e,1,r,0,l=>{if(n?.(l,a),l.id in o&&vo(),o[l.id]=l,a!==0&&l.path){const u=LV(l.fullPath);(!s[u]||l.fullPath.endsWith("/"))&&(s[u]=l)}a++}),Go(r),{processedTree:{segmentTree:r,singleCache:Lh(1e3),matchCache:Lh(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:s}}function FC(e,t,n=!1){const r=e.split("/"),i=FV(e,r,t,n);if(!i)return null;const[o]=cB(e,r,i);return{route:i.node.route,rawParams:o}}function cB(e,t,n){const r=BV(n.node);let i=null;const o=Object.create(null);let s=n.extract?.part??0,a=n.extract?.node??0,l=n.extract?.path??0,u=n.extract?.segment??0;for(;a<r.length;s++,a++,l++,u++){const c=r[a];if(c.kind===ss)break;if(c.kind===lB){u--,s--,l--;continue}const f=t[s],h=l;if(f&&(l+=f.length),c.kind===1){i??=n.node.fullPath.split("/");const d=i[u],p=c.prefix?.length??0;if(d.charCodeAt(p)===123){const m=c.suffix?.length??0,v=d.substring(p+2,d.length-m-1),b=f.substring(p,f.length-m);o[v]=decodeURIComponent(b)}else{const m=d.substring(1);o[m]=decodeURIComponent(f)}}else if(c.kind===3){if(n.skipped&1<<a){s--,l=h-1;continue}i??=n.node.fullPath.split("/");const d=i[u],p=c.prefix?.length??0,m=c.suffix?.length??0,v=d.substring(p+3,d.length-m-1),b=c.suffix||c.prefix?f.substring(p,f.length-m):f;b&&(o[v]=decodeURIComponent(b))}else if(c.kind===2){const d=c,p=e.substring(h+(d.prefix?.length??0),e.length-(d.suffix?.length??0)),m=decodeURIComponent(p);o["*"]=m,o._splat=m;break}}return n.rawParams&&Object.assign(o,n.rawParams),[o,{part:s,node:a,path:l,segment:u}]}function fB(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function BV(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function FV(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!Rh(t),o=i&&e!=="/",s=t.length-(i?1:0),a=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let l=null,u=null;for(;a.length;){const c=a.pop(),{node:f,index:h,skipped:d,depth:p,statics:m,dynamics:v,optionals:b}=c;let{extract:y,rawParams:x}=c;if(f.kind===2&&f.route&&!Rp(u,c))continue;if(f.parse){if(!LT(e,t,c))continue;x=c.rawParams,y=c.extract}r&&f.route&&f.kind!==ss&&Rp(l,c)&&(l=c);const k=h===s;if(k&&(f.route&&(!o||f.kind===ss||f.kind===2)&&Rp(u,c)&&(u=c),!f.optional&&!f.wildcard&&!f.index&&!f.pathless))continue;const w=k?void 0:t[h];let S;if(k&&f.index){const O={node:f.index,index:h,skipped:d,depth:p+1,statics:m,dynamics:v,optionals:b,extract:y,rawParams:x};let A=!0;if(f.index.parse&&(LT(e,t,O)||(A=!1)),A){if(!v&&!b&&!d&&zV(m,s))return O;Rp(u,O)&&(u=O)}}if(f.wildcard)for(let O=f.wildcard.length-1;O>=0;O--){const A=f.wildcard[O],{prefix:P,suffix:M}=A;if(!(P&&(k||!(A.caseSensitive?w:S??=w.toLowerCase()).startsWith(P)))){if(M){if(k)continue;const j=t.slice(h).join("/").slice(-M.length);if((A.caseSensitive?j:j.toLowerCase())!==M)continue}a.push({node:A,index:s,skipped:d,depth:p+1,statics:m,dynamics:v,optionals:b,extract:y,rawParams:x})}}if(f.optional){const O=d|1<<p,A=p+1;for(let P=f.optional.length-1;P>=0;P--){const M=f.optional[P];a.push({node:M,index:h,skipped:O,depth:A,statics:m,dynamics:v,optionals:b,extract:y,rawParams:x})}if(!k)for(let P=f.optional.length-1;P>=0;P--){const M=f.optional[P],{prefix:j,suffix:E}=M;if(j||E){const D=M.caseSensitive?w:S??=w.toLowerCase();if(j&&!D.startsWith(j)||E&&!D.endsWith(E))continue}a.push({node:M,index:h+1,skipped:d,depth:A,statics:m,dynamics:v,optionals:b+Np(s,h),extract:y,rawParams:x})}}if(!k&&f.dynamic&&w)for(let O=f.dynamic.length-1;O>=0;O--){const A=f.dynamic[O],{prefix:P,suffix:M}=A;if(P||M){const j=A.caseSensitive?w:S??=w.toLowerCase();if(P&&!j.startsWith(P)||M&&!j.endsWith(M))continue}a.push({node:A,index:h+1,skipped:d,depth:p+1,statics:m,dynamics:v+Np(s,h),optionals:b,extract:y,rawParams:x})}if(!k&&f.staticInsensitive){const O=f.staticInsensitive.get(S??=w.toLowerCase());O&&a.push({node:O,index:h+1,skipped:d,depth:p+1,statics:m+Np(s,h),dynamics:v,optionals:b,extract:y,rawParams:x})}if(!k&&f.static){const O=f.static.get(w);O&&a.push({node:O,index:h+1,skipped:d,depth:p+1,statics:m+Np(s,h),dynamics:v,optionals:b,extract:y,rawParams:x})}if(f.pathless){const O=p+1;for(let A=f.pathless.length-1;A>=0;A--){const P=f.pathless[A];a.push({node:P,index:h,skipped:d,depth:O,statics:m,dynamics:v,optionals:b,extract:y,rawParams:x})}}}if(u)return u;if(r&&l){let c=l.index;for(let h=0;h<l.index;h++)c+=t[h].length;const f=c===e.length?"/":e.slice(c);return l.rawParams??=Object.create(null),l.rawParams["**"]=decodeURIComponent(f),l}return null}function Np(e,t){return 2**(e-t-1)}function zV(e,t){return e===2**(t-1)-1}function LT(e,t,n){let r,i;try{[r,i]=cB(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function Rp(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===ss)>(e.node.kind===ss)||t.node.kind===ss==(e.node.kind===ss)&&t.depth>e.depth))):!0}function Vm(e){return zC(e.filter(t=>t!==void 0).join("/"))}function zC(e){return e.replace(/\/{2,}/g,"/")}function hB(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function po(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function dB(e){return po(hB(e))}function Dg(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function WV(e,t,n){return Dg(e,n)===Dg(t,n)}function UV({base:e,to:t,trailingSlash:n="never",cache:r}){const i=t.startsWith("/"),o=!i&&t===".";let s;if(r){s=i?t:o?e:e+"\0"+t;const u=r.get(s);if(u)return u}let a;if(o)a=e.split("/");else if(i)a=t.split("/");else{for(a=e.split("/");a.length>1&&Rh(a)==="";)a.pop();const u=t.split("/");for(let c=0,f=u.length;c<f;c++){const h=u[c];h===""?c?c===f-1&&a.push(h):a=[h]:h===".."?a.pop():h==="."||a.push(h)}}a.length>1&&(Rh(a)===""?n==="never"&&a.pop():n==="always"&&a.push(""));const l=zC(a.join("/"))||"/";return s&&r&&r.set(s,l),l}function HV(e){const t=new Map(e.map(i=>[encodeURIComponent(i),i])),n=Array.from(t.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return i=>i.replace(r,o=>t.get(o)??o)}function Yb(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(i=>BT(i,n)).join("/"):BT(r,n)}function $T({path:e,params:t,decoder:n,...r}){let i=!1;const o=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:o,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:o,isMissingParams:i};const s=e.length;let a=0,l,u="";for(;a<s;){const c=a;l=uB(e,c,l);const f=l[5];if(a=f+1,c===f)continue;const h=l[0];if(h===0){u+="/"+e.substring(c,f);continue}if(h===2){const d=t._splat;o._splat=d,o["*"]=d;const p=e.substring(c,l[1]),m=e.substring(l[4],f);if(!d){i=!0,(p||m)&&(u+="/"+p+m);continue}const v=Yb("_splat",t,n);u+="/"+p+v+m;continue}if(h===1){const d=e.substring(l[2],l[3]);!i&&!(d in t)&&(i=!0),o[d]=t[d];const p=e.substring(c,l[1]),m=e.substring(l[4],f),v=Yb(d,t,n)??"undefined";u+="/"+p+v+m;continue}if(h===3){const d=e.substring(l[2],l[3]),p=t[d];if(p==null)continue;o[d]=p;const m=e.substring(c,l[1]),v=e.substring(l[4],f),b=Yb(d,t,n)??"";u+="/"+m+b+v;continue}}return e.endsWith("/")&&(u+="/"),{usedParams:o,interpolatedPath:u||"/",isMissingParams:i}}function BT(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function vn(e){return e?.isNotFound===!0}function VV(){try{return typeof window<"u"&&typeof window.sessionStorage=="object"?window.sessionStorage:void 0}catch{return}}const qV="tsr-scroll-restoration-v1_3";function KV(){const e=VV();if(!e)return null;let t={};try{const r=JSON.parse(e.getItem("tsr-scroll-restoration-v1_3")||"{}");Bu(r)&&(t=r)}catch{}return{get state(){return t},set:r=>{t=is(r,t)||t},persist:()=>{try{e.setItem(qV,JSON.stringify(t))}catch{}}}}const FT=KV(),GV=e=>e.state.__TSR_key||e.href;function QV(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let Dp=!1;const af="window",zT="data-scroll-restoration-id";function XV(e,t){if(!FT)return;const n=FT;if((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!n)return;e.isScrollRestorationSetup=!0,Dp=!1;const r=e.options.getScrollRestorationKey||GV,i=new Map;window.history.scrollRestoration="manual";const o=a=>{if(!(Dp||!e.isScrollRestoring))if(a.target===document||a.target===window)i.set(af,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{const l=a.target;i.set(l,{scrollX:l.scrollLeft||0,scrollY:l.scrollTop||0})}},s=a=>{if(!e.isScrollRestoring||!a||i.size===0||!n)return;const l=n.state[a]||={};for(const[u,c]of i){let f;if(u===af)f=af;else if(u.isConnected){const h=u.getAttribute(zT);f=h?`[${zT}="${h}"]`:QV(u)}f&&(l[f]=c)}};document.addEventListener("scroll",o,!0),e.subscribe("onBeforeLoad",a=>{s(a.fromLocation?r(a.fromLocation):void 0),i.clear()}),window.addEventListener("pagehide",()=>{s(r(e.stores.resolvedLocation.get()??e.stores.location.get())),n.persist()}),e.subscribe("onRendered",a=>{const l=r(a.toLocation),u=e.options.scrollRestorationBehavior,c=e.options.scrollToTopSelectors;if(i.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))){Dp=!0;try{const f=e.isScrollRestoring?n.state[l]:void 0;let h=!1;if(f)for(const d in f){const p=f[d];if(!Bu(p))continue;const{scrollX:m,scrollY:v}=p;if(!(!Number.isFinite(m)||!Number.isFinite(v))){if(d===af)window.scrollTo({top:v,left:m,behavior:u}),h=!0;else if(d){let b;try{b=document.querySelector(d)}catch{continue}b&&(b.scrollLeft=m,b.scrollTop=v,h=!0)}}}if(!h){const d=e.history.location.hash.slice(1);if(d){const p=window.history.state?.__hashScrollIntoViewOptions??!0;if(p){const m=document.getElementById(d);m&&m.scrollIntoView(p)}}else{const p={top:0,left:0,behavior:u};if(window.scrollTo(p),c)for(const m of c){if(m===af)continue;const v=typeof m=="function"?m():document.querySelector(m);v&&v.scrollTo(p)}}}}finally{Dp=!1}e.isScrollRestoring&&n.set(f=>(f[l]||={},f))}})}function YV(e,t=String){const n=new URLSearchParams;for(const r in e){const i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function Zb(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function ZV(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,i]of t.entries()){const o=n[r];o==null?n[r]=Zb(i):Array.isArray(o)?o.push(Zb(i)):n[r]=[o,Zb(i)]}return n}const JV=tq(JSON.parse),eq=nq(JSON.stringify,JSON.parse);function tq(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=ZV(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function nq(e,t){const n=typeof t=="function";function r(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(n&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const o=YV(i,r);return o?`?${o}`:""}}const Ia="__root__";function rq(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Vn(e){return e instanceof Response&&!!e.options}function iq(e){return{input:({url:t})=>{for(const n of e)t=Lw(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=pB(e[n],t);return t}}}function oq(e){const t=dB(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),o=e.caseSensitive?r:r.toLowerCase();return{input:({url:s})=>{const a=e.caseSensitive?s.pathname:s.pathname.toLowerCase();return a===i?s.pathname="/":a.startsWith(o)&&(s.pathname=s.pathname.slice(n.length)),s},output:({url:s})=>(s.pathname=Vm(["/",t,s.pathname]),s)}}function Lw(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function pB(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function sq(e,t){const{createMutableStore:n,createReadonlyStore:r,batch:i,init:o}=t,s=new Map,a=new Map,l=new Map,u=n(e.status),c=n(e.loadedAt),f=n(e.isLoading),h=n(e.isTransitioning),d=n(e.location),p=n(e.resolvedLocation),m=n(e.statusCode),v=n(e.redirect),b=n([]),y=n([]),x=n([]),k=r(()=>Jb(s,b.get())),w=r(()=>Jb(a,y.get())),S=r(()=>Jb(l,x.get())),O=r(()=>b.get()[0]),A=r(()=>b.get().some(F=>s.get(F)?.get().status==="pending")),P=r(()=>({locationHref:d.get().href,resolvedLocationHref:p.get()?.href,status:u.get()})),M=r(()=>({status:u.get(),loadedAt:c.get(),isLoading:f.get(),isTransitioning:h.get(),matches:k.get(),location:d.get(),resolvedLocation:p.get(),statusCode:m.get(),redirect:v.get()})),j=Lh(64);function E(F){let $=j.get(F);return $||($=r(()=>{const z=b.get();for(const T of z){const q=s.get(T);if(q&&q.routeId===F)return q.get()}}),j.set(F,$)),$}const D={status:u,loadedAt:c,isLoading:f,isTransitioning:h,location:d,resolvedLocation:p,statusCode:m,redirect:v,matchesId:b,pendingIds:y,cachedIds:x,matches:k,pendingMatches:w,cachedMatches:S,firstId:O,hasPending:A,matchRouteDeps:P,matchStores:s,pendingMatchStores:a,cachedMatchStores:l,__store:M,getRouteMatchStore:E,setMatches:R,setPending:N,setCached:B};R(e.matches),o?.(D);function R(F){ex(F,s,b,n,i)}function N(F){ex(F,a,y,n,i)}function B(F){ex(F,l,x,n,i)}return D}function Jb(e,t){const n=[];for(const r of t){const i=e.get(r);i&&n.push(i.get())}return n}function ex(e,t,n,r,i){const o=e.map(a=>a.id),s=new Set(o);i(()=>{for(const a of t.keys())s.has(a)||t.delete(a);for(const a of e){const l=t.get(a.id);if(!l){const u=r(a);u.routeId=a.routeId,t.set(a.id,u);continue}l.routeId=a.routeId,l.get()!==a&&l.set(a)}jV(n.get(),o)||n.set(o)})}const $w=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},aq=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),Gv=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),Na=(e,t,n=!0)=>{const r={...e.router.options.context??{}},i=n?t:t-1;for(let o=0;o<=i;o++){const s=e.matches[o];if(!s)continue;const a=e.router.getMatch(s.id);a&&Object.assign(r,a.__routeContext,a.__beforeLoadContext)}return r},WT=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(s=>s.routeId===e.router.routeTree.id),i=r>=0?r:0;let o=n?e.matches.findIndex(s=>s.routeId===n):e.firstBadMatchIndex??e.matches.length-1;o<0&&(o=i);for(let s=o;s>=0;s--){const a=e.matches[s];if(e.router.looseRoutesById[a.routeId].options.notFoundComponent)return s}return n?o:i},as=(e,t,n)=>{if(!(!Vn(n)&&!vn(n)))throw Vn(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:Vn(n)?"redirected":vn(n)?"notFound":r.status==="pending"?"success":r.status,context:Na(e,t.index),isFetching:!1,error:n})),vn(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Vn(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},mB=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},UT=(e,t,n)=>{const r=Na(e,n);e.updateMatch(t,i=>({...i,context:r}))},lf=(e,t,n,r)=>{const{id:i,routeId:o}=e.matches[t],s=e.router.looseRoutesById[o];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,as(e,e.router.getMatch(i),n);try{s.options.onError?.(n)}catch(a){n=a,as(e,e.router.getMatch(i),n)}e.updateMatch(i,a=>(a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,a._nonReactive.loadPromise?.resolve(),{...a,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Vn(n)&&!vn(n)&&(e.serialError??=n)},gB=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Gv(e,t)&&(n.options.loader||n.options.beforeLoad||vB(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const o=setTimeout(()=>{$w(e)},i);r._nonReactive.pendingTimeout=o}},lq=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;gB(e,t,n,r);const i=()=>{const o=e.router.getMatch(t);o.preload&&(o.status==="redirected"||o.status==="notFound")&&as(e,o,o.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},uq=(e,t,n,r)=>{const i=e.router.getMatch(t);let o=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Fu(()=>{o?.resolve(),o=void 0});const{paramsError:s,searchError:a}=i;s&&lf(e,n,s,"PARSE_PARAMS"),a&&lf(e,n,a,"VALIDATE_SEARCH"),gB(e,t,r,i);const l=new AbortController;let u=!1;const c=()=>{u||(u=!0,e.updateMatch(t,k=>({...k,isFetching:"beforeLoad",fetchCount:k.fetchCount+1,abortController:l})))},f=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,k=>({...k,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{c(),f()});return}i._nonReactive.beforeLoadPromise=Fu();const h={...Na(e,n,!1),...i.__routeContext},{search:d,params:p,cause:m}=i,v=Gv(e,t),b={search:d,abortController:l,params:p,preload:v,context:h,location:e.location,navigate:k=>e.router.navigate({...k,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?"preload":m,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},y=k=>{if(k===void 0){e.router.batch(()=>{c(),f()});return}(Vn(k)||vn(k))&&(c(),lf(e,n,k,"BEFORE_LOAD")),e.router.batch(()=>{c(),e.updateMatch(t,w=>({...w,__beforeLoadContext:k})),f()})};let x;try{if(x=r.options.beforeLoad(b),Dh(x))return c(),x.catch(k=>{lf(e,n,k,"BEFORE_LOAD")}).then(y)}catch(k){c(),lf(e,n,k,"BEFORE_LOAD")}y(x)},cq=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],o=()=>a(),s=()=>uq(e,n,t,i),a=()=>{if(mB(e,n))return;const l=lq(e,n,i);return Dh(l)?l.then(s):s()};return o()},fq=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([o,s,a])=>({meta:o?.meta,links:o?.links,headScripts:o?.scripts,headers:a,scripts:s,styles:o?.styles}))},yB=(e,t,n,r,i)=>{const o=t[r-1],{params:s,loaderDeps:a,abortController:l,cause:u}=e.router.getMatch(n),c=Na(e,r),f=Gv(e,n);return{params:s,deps:a,preload:!!f,parentMatchPromise:o,abortController:l,context:c,location:e.location,navigate:h=>e.router.navigate({...h,_fromLocation:e.location}),cause:f?"preload":u,route:i,...e.router.options.additionalContext}},HT=async(e,t,n,r,i)=>{try{const o=e.router.getMatch(n);try{(!(oB??e.router.isServer)||o.ssr===!0)&&$h(i);const s=i.options.loader,a=typeof s=="function"?s:s?.handler,l=a?.(yB(e,t,n,r,i)),u=!!a&&Dh(l);if((u||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||o._nonReactive.minPendingPromise)&&e.updateMatch(n,f=>({...f,isFetching:"loader"})),a){const f=u?await l:l;as(e,e.router.getMatch(n),f),f!==void 0&&e.updateMatch(n,h=>({...h,loaderData:f}))}i._lazyPromise&&await i._lazyPromise;const c=o._nonReactive.minPendingPromise;c&&await c,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,f=>({...f,error:void 0,context:Na(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(s){let a=s;if(a?.name==="AbortError"){if(o.abortController.signal.aborted){o._nonReactive.loaderPromise?.resolve(),o._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,u=>({...u,status:u.status==="pending"?"success":u.status,isFetching:!1,context:Na(e,r)}));return}const l=o._nonReactive.minPendingPromise;l&&await l,vn(s)&&await i.options.notFoundComponent?.preload?.(),as(e,e.router.getMatch(n),s);try{i.options.onError?.(s)}catch(u){a=u,as(e,e.router.getMatch(n),u)}!Vn(a)&&!vn(a)&&await $h(i,["errorComponent"]),e.updateMatch(n,u=>({...u,error:a,context:Na(e,r),status:"error",isFetching:!1}))}}catch(o){const s=e.router.getMatch(n);s&&(s._nonReactive.loaderPromise=void 0),as(e,s,o)}},hq=async(e,t,n)=>{async function r(d,p,m,v,b){const y=Date.now()-p.updatedAt,x=d?b.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:b.options.staleTime??e.router.options.defaultStaleTime??0,k=b.options.shouldReload,w=typeof k=="function"?k(yB(e,t,i,n,b)):k,{status:S,invalid:O}=v,A=y>=x&&(!!e.forceStaleReload||v.cause==="enter"||m!==void 0&&m!==v.id);s=S==="success"&&(O||(w??A)),d&&b.options.preload===!1||(s&&!e.sync&&c?(a=!0,(async()=>{try{await HT(e,t,i,n,b);const P=e.router.getMatch(i);P._nonReactive.loaderPromise?.resolve(),P._nonReactive.loadPromise?.resolve(),P._nonReactive.loaderPromise=void 0,P._nonReactive.loadPromise=void 0}catch(P){Vn(P)&&await e.router.navigate(P.options)}})()):S!=="success"||s?await HT(e,t,i,n,b):UT(e,i,n))}const{id:i,routeId:o}=e.matches[n];let s=!1,a=!1;const l=e.router.looseRoutesById[o],u=l.options.loader,c=((typeof u=="function"?void 0:u?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(mB(e,i)){if(!e.router.getMatch(i))return e.matches[n];UT(e,i,n)}else{const d=e.router.getMatch(i),p=e.router.stores.matchesId.get()[n],m=(p&&e.router.stores.matchStores.get(p)||null)?.routeId===o?p:e.router.stores.matches.get().find(b=>b.routeId===o)?.id,v=Gv(e,i);if(d._nonReactive.loaderPromise){if(d.status==="success"&&!e.sync&&!d.preload&&c)return d;await d._nonReactive.loaderPromise;const b=e.router.getMatch(i),y=b._nonReactive.error||b.error;y&&as(e,b,y),b.status==="pending"&&await r(v,d,m,b,l)}else{const b=v&&!e.router.stores.matchStores.has(i),y=e.router.getMatch(i);y._nonReactive.loaderPromise=Fu(),b!==y.preload&&e.updateMatch(i,x=>({...x,preload:b})),await r(v,d,m,y,l)}}const f=e.router.getMatch(i);a||(f._nonReactive.loaderPromise?.resolve(),f._nonReactive.loadPromise?.resolve(),f._nonReactive.loadPromise=void 0),clearTimeout(f._nonReactive.pendingTimeout),f._nonReactive.pendingTimeout=void 0,a||(f._nonReactive.loaderPromise=void 0),f._nonReactive.dehydrated=void 0;const h=a?f.isFetching:!1;return h!==f.isFetching||f.invalid!==!1?(e.updateMatch(i,d=>({...d,isFetching:h,invalid:!1})),e.router.getMatch(i)):f};async function VT(e){const t=e,n=[];aq(t.router)&&$w(t);let r;for(let h=0;h<t.matches.length;h++){try{const d=cq(t,h);Dh(d)&&await d}catch(d){if(Vn(d))throw d;if(vn(d))r=d;else if(!t.preload)throw d;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const i=t.firstBadMatchIndex??t.matches.length,o=r&&!t.preload?WT(t,r):void 0,s=r&&t.preload?0:o!==void 0?Math.min(o+1,i):i;let a,l;for(let h=0;h<s;h++)n.push(hq(t,n,h));try{await Promise.all(n)}catch{const h=await Promise.allSettled(n);for(const d of h){if(d.status!=="rejected")continue;const p=d.reason;if(Vn(p))throw p;vn(p)?a??=p:l??=p}if(l!==void 0)throw l}const u=a??(r&&!t.preload?r:void 0);let c=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!u&&r&&t.preload)return t.matches;if(u){const h=WT(t,u);h===void 0&&vo();const d=t.matches[h],p=t.router.looseRoutesById[d.routeId],m=t.router.options?.defaultNotFoundComponent;!p.options.notFoundComponent&&m&&(p.options.notFoundComponent=m),u.routeId=d.routeId;const v=d.routeId===t.router.routeTree.id;t.updateMatch(d.id,b=>({...b,...v?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:u},isFetching:!1})),c=h,await $h(p,["notFoundComponent"])}else if(!t.preload){const h=t.matches[0];h.globalNotFound||t.router.getMatch(h.id)?.globalNotFound&&t.updateMatch(h.id,d=>({...d,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const h=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await $h(h,["errorComponent"])}for(let h=0;h<=c;h++){const{id:d,routeId:p}=t.matches[h],m=t.router.looseRoutesById[p];try{const v=fq(t,d,m);if(v){const b=await v;t.updateMatch(d,y=>({...y,...b}))}}catch(v){console.error(`Error executing head for route ${p}:`,v)}}const f=$w(t);if(Dh(f)&&await f,u)throw u;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function qT(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function $h(e,t=qm){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:i,...o}=r.options;Object.assign(e.options,o),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===qm?(()=>{if(e._componentsPromise===void 0){const r=qT(e,qm);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():qT(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function vB(e){for(const t of qm)if(e.options[t]?.preload)return!0;return!1}const qm=["component","errorComponent","pendingComponent","notFoundComponent"];var xs="__TSR_index",KT="popstate",GT="beforeunload";function dq(e){let t=e.getLocation();const n=new Set,r=s=>{t=e.getLocation(),n.forEach(a=>a({location:t,action:s}))},i=s=>{e.notifyOnIndexChange??!0?r(s):t=e.getLocation()},o=async({task:s,navigateOpts:a,...l})=>{if(a?.ignoreBlocker??!1){s();return}const u=e.getBlockers?.()??[],c=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&u.length&&c)for(const f of u){const h=Lg(l.path,l.state);if(await f.blockerFn({currentLocation:t,nextLocation:h,action:l.type})){e.onBlocked?.();return}}s()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:s=>(n.add(s),()=>{n.delete(s)}),push:(s,a,l)=>{const u=t.state[xs];a=QT(u+1,a),o({task:()=>{e.pushState(s,a),r({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:s,state:a})},replace:(s,a,l)=>{const u=t.state[xs];a=QT(u,a),o({task:()=>{e.replaceState(s,a),r({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:s,state:a})},go:(s,a)=>{o({task:()=>{e.go(s),i({type:"GO",index:s})},navigateOpts:a,type:"GO"})},back:s=>{o({task:()=>{e.back(s?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:s,type:"BACK"})},forward:s=>{o({task:()=>{e.forward(s?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:s,type:"FORWARD"})},canGoBack:()=>t.state[xs]!==0,createHref:s=>e.createHref(s),block:s=>{if(!e.setBlockers)return()=>{};const a=e.getBlockers?.()??[];return e.setBlockers([...a,s]),()=>{const l=e.getBlockers?.()??[];e.setBlockers?.(l.filter(u=>u!==s))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function QT(e,t){t||(t={});const n=WC();return{...t,key:n,__TSR_key:n,[xs]:e}}function pq(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let i=[];const o=()=>i,s=A=>i=A,a=A=>A,l=()=>Lg(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state);if(!t.history.state?.__TSR_key&&!t.history.state?.key){const A=WC();t.history.replaceState({[xs]:0,key:A,__TSR_key:A},"")}let u=l(),c,f=!1,h=!1,d=!1,p=!1;const m=()=>u;let v,b;const y=()=>{v&&(O._ignoreSubscribers=!0,(v.isPush?t.history.pushState:t.history.replaceState)(v.state,"",v.href),O._ignoreSubscribers=!1,v=void 0,b=void 0,c=void 0)},x=(A,P,M)=>{const j=a(P);b||(c=u),u=Lg(P,M),v={href:j,state:M,isPush:v?.isPush||A==="push"},b||(b=Promise.resolve().then(()=>y()))},k=A=>{u=l(),O.notify({type:A})},w=async()=>{if(h){h=!1;return}const A=l(),P=A.state[xs]-u.state[xs],M=P===1,j=P===-1,E=!M&&!j||f;f=!1;const D=E?"GO":j?"BACK":"FORWARD",R=E?{type:"GO",index:P}:{type:j?"BACK":"FORWARD"};if(d)d=!1;else{const N=o();if(typeof document<"u"&&N.length){for(const B of N)if(await B.blockerFn({currentLocation:u,nextLocation:A,action:D})){h=!0,t.history.go(1),O.notify(R);return}}}u=l(),O.notify(R)},S=A=>{if(p){p=!1;return}let P=!1;const M=o();if(typeof document<"u"&&M.length)for(const j of M){const E=j.enableBeforeUnload??!0;if(E===!0){P=!0;break}if(typeof E=="function"&&E()===!0){P=!0;break}}if(P)return A.preventDefault(),A.returnValue=""},O=dq({getLocation:m,getLength:()=>t.history.length,pushState:(A,P)=>x("push",A,P),replaceState:(A,P)=>x("replace",A,P),back:A=>(A&&(d=!0),p=!0,t.history.back()),forward:A=>{A&&(d=!0),p=!0,t.history.forward()},go:A=>{f=!0,t.history.go(A)},createHref:A=>a(A),flush:y,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(GT,S,{capture:!0}),t.removeEventListener(KT,w)},onBlocked:()=>{c&&u!==c&&(u=c)},getBlockers:o,setBlockers:s,notifyOnIndexChange:!1});return t.addEventListener(GT,S,{capture:!0}),t.addEventListener(KT,w),t.history.pushState=function(...A){const P=n.apply(t.history,A);return O._ignoreSubscribers||k("PUSH"),P},t.history.replaceState=function(...A){const P=r.apply(t.history,A);return O._ignoreSubscribers||k("REPLACE"),P},O}function mq(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Lg(e,t){const n=mq(e),r=n.indexOf("#"),i=n.indexOf("?"),o=WC();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):"",search:i>-1?n.slice(i,r===-1?void 0:r):"",state:t||{[xs]:0,key:o,__TSR_key:o}}}function WC(){return(Math.random()+1).toString(36).substring(7)}function yu(e,t){const n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var gq=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.routeBranchCache=new WeakMap,this.startTransition=n=>n(),this.update=n=>{const r=this.options,i=this.basepath??r?.basepath??"/",o=this.basepath===void 0,s=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=HV(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=pq()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let c;this.resolvePathCache=Lh(1e3),c=this.buildRouteTree(),this.setRoutes(c)}if(!this.stores&&this.latestLocation){const c=this.getStoreConfig(this);this.batch=c.batch,this.stores=sq(vq(this.latestLocation),c),XV(this)}let a=!1;const l=this.options.basepath??"/",u=this.options.rewrite;if(o||i!==l||s!==u){this.basepath=l;const c=[],f=dB(l);f&&f!=="/"&&c.push(oq({basepath:l})),u&&c.push(u),this.rewrite=c.length===0?void 0:c.length===1?c[0]:iq(c),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=$V(this.routeTree,this.options.caseSensitive,(r,i)=>{r.init({originalIndex:i})});return this.options.routeMasks&&IV(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const i={eventType:n,fn:r};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const i=({pathname:l,search:u,hash:c,href:f,state:h})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const b=this.options.parseSearch(u),y=this.options.stringifySearch(b);return{href:l+y+c,publicHref:l+y+c,pathname:sf(l).path,external:!1,searchStr:y,search:ea(r?.search,b),hash:sf(c.slice(1)).path,state:os(r?.state,h)}}const d=new URL(f,this.origin),p=Lw(this.rewrite,d),m=this.options.parseSearch(p.search),v=this.options.stringifySearch(m);return p.search=v,{href:p.href.replace(p.origin,""),publicHref:f,pathname:sf(p.pathname).path,external:!!this.rewrite&&p.origin!==this.origin,searchStr:v,search:ea(r?.search,m),hash:sf(p.hash.slice(1)).path,state:os(r?.state,h)}},o=i(n),{__tempLocation:s,__tempKey:a}=o.state;if(s&&(!a||a===this.tempLocationKey)){const l=i(s);return l.state.key=o.state.key,l.state.__TSR_key=o.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:o}}return o},this.resolvePathWithBase=(n,r)=>UV({base:n,to:r.includes("//")?zC(r):r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,i)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},i):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>bq({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(n=>{this.cancelMatch(n)}),this.stores.matchesId.get().forEach(n=>{if(this.stores.pendingMatchStores.has(n))return;const r=this.stores.matchStores.get(n)?.get();r&&(r.status==="pending"||r.isFetching==="loader")&&this.cancelMatch(n)})},this.buildLocation=n=>{const r=(o={})=>{const s=o._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutesLightweight(s);o.from;const l=o.unsafeRelative==="path"?s.pathname:o.from??a.fullPath,u=o.to?`${o.to}`:void 0,c=a.search,f=Object.assign(Object.create(null),a.params),h=u?.charCodeAt(0)===47?"/":this.resolvePathWithBase(l,"."),d=u?this.resolvePathWithBase(h,u):h,p=o.params===!1||o.params===null?Object.create(null):(o.params??!0)===!0?f:Object.assign(f,is(o.params,f)),m=this.routesByPath[po(d)];let v;if(m)v=this.getRouteBranch(m);else if(d.includes("$"))v=[];else{const j=this.getMatchedRoutes(d);v=j.matchedRoutes,this.options.notFoundRoute&&(!j.foundRoute||j.foundRoute.path!=="/"&&j.routeParams["**"])&&(v=[...v,this.options.notFoundRoute])}if(v.length&&aB(p))for(const j of v){const E=j.options.params?.stringify??j.options.stringifyParams;if(E)try{Object.assign(p,E(p))}catch{}}const b=n.leaveParams?d:sf($T({path:d,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let y=c;if(n._includeValidateSearch&&this.options.search?.strict){const j={};v.forEach(E=>{if(E.options.validateSearch)try{Object.assign(j,Km(E.options.validateSearch,{...j,...y}))}catch{}}),y=j}y=xq({search:y,dest:o,destRoutes:v,_includeValidateSearch:n._includeValidateSearch}),y=ea(c,y);const x=this.options.stringifySearch(y),k=o.hash===!0?s.hash:o.hash?is(o.hash,s.hash):void 0,w=k?`#${k}`:"";let S=o.state===!0?s.state:o.state?is(o.state,s.state):{};S=os(s.state,S);const O=`${b}${x}${w}`;let A,P,M=!1;if(this.rewrite){const j=new URL(O,this.origin),E=pB(this.rewrite,j);A=j.href.replace(j.origin,""),E.origin!==this.origin?(P=E.href,M=!0):P=E.pathname+E.search+E.hash}else A=_V(O),P=A;return{publicHref:P,href:A,pathname:b,search:y,searchStr:x,state:S,hash:k??"",external:M,unmaskOnReload:o.unmaskOnReload}},i=(o={},s)=>{const a=r(o);let l=s?r(s):void 0;if(!l){const u=Object.create(null);if(this.options.routeMasks){const c=NV(a.pathname,this.processedTree);if(c){Object.assign(u,c.rawParams);const{from:f,params:h,...d}=c.route,p=h===!1||h===null?Object.create(null):(h??!0)===!0?u:Object.assign(u,is(h,u));s={from:n.from,...d,params:p},l=r(s)}}}return l&&(a.maskedLocation=l),a};return n.mask?i(n,{from:n.from,...n.mask}):i(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...i})=>{const o=()=>{const l=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];l.forEach(c=>{i.state[c]=this.latestLocation.state[c]});const u=Ma(i.state,this.latestLocation.state);return l.forEach(c=>{delete i.state[c]}),u},s=po(this.latestLocation.href)===po(i.href);let a=this.commitLocationPromise;if(this.commitLocationPromise=Fu(()=>{a?.resolve(),a=void 0}),s&&o())this.load();else{let{maskedLocation:l,hashScrollIntoView:u,...c}=i;l&&(c={...l,state:{...l.state,__tempKey:void 0,__tempLocation:{...c,search:c.searchStr,state:{...c.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(c.unmaskOnReload??this.options.unmaskOnReload??!1)&&(c.state.__tempKey=this.tempLocationKey)),c.state.__hashScrollIntoViewOptions=u??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[i.replace?"replace":"push"](c.publicHref,c.state,{ignoreBlocker:r})}return this.resetNextScroll=i.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:i,viewTransition:o,ignoreBlocker:s,href:a,...l}={})=>{if(a){const f=this.history.location.state.__TSR_index,h=Lg(a,{__TSR_index:n?f:f+1}),d=new URL(h.pathname,this.origin);l.to=Lw(this.rewrite,d).pathname,l.search=this.options.parseSearch(h.search),l.hash=h.hash.slice(1)}const u=this.buildLocation({...l,_includeValidateSearch:!0});this.pendingBuiltLocation=u;const c=this.commitLocation({...u,viewTransition:o,replace:n,resetScroll:r,hashScrollIntoView:i,ignoreBlocker:s});return Promise.resolve().then(()=>{this.pendingBuiltLocation===u&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:n,reloadDocument:r,href:i,publicHref:o,...s})=>{let a=!1;if(i)try{new URL(`${i}`),a=!0}catch{}if(a&&!r&&(r=!0),r){if(n!==void 0||!i){const u=this.buildLocation({to:n,...s});i=i??u.publicHref,o=o??u.publicHref}const l=!a&&o?o:i;if(Rg(l,this.protocolAllowlist))return Promise.resolve();if(!s.ignoreBlocker){const u=this.history.getBlockers?.()??[];for(const c of u)if(c?.blockerFn&&await c.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return s.replace?window.location.replace(l):window.location.href=l,Promise.resolve()}return this.buildAndCommitLocation({...s,href:i,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation),r=this.stores.cachedMatches.get().filter(i=>!n.some(o=>o.id===i.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(n),this.stores.setCached(r)})},this.load=async n=>{let r,i,o;const s=this.stores.resolvedLocation.get()??this.stores.location.get();for(o=new Promise(l=>{this.startTransition(async()=>{try{this.beforeLoad();const u=this.latestLocation,c=yu(u,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...c}),this.emit({type:"onBeforeLoad",...c}),await VT({router:this,sync:n?.sync,forceStaleReload:s.href===u.href,matches:this.stores.pendingMatches.get(),location:u,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let f=null,h=null,d=null,p=null;this.batch(()=>{const m=this.stores.pendingMatches.get(),v=m.length,b=this.stores.matches.get();f=v?b.filter(k=>!this.stores.pendingMatchStores.has(k.id)):null;const y=new Set;for(const k of this.stores.pendingMatchStores.values())k.routeId&&y.add(k.routeId);const x=new Set;for(const k of this.stores.matchStores.values())k.routeId&&x.add(k.routeId);h=v?b.filter(k=>!y.has(k.routeId)):null,d=v?m.filter(k=>!x.has(k.routeId)):null,p=v?m.filter(k=>x.has(k.routeId)):b,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),v&&(this.stores.setMatches(m),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...f.filter(k=>k.status!=="error"&&k.status!=="notFound"&&k.status!=="redirected")]),this.clearExpiredCache())});for(const[m,v]of[[h,"onLeave"],[d,"onEnter"],[p,"onStay"]])if(m)for(const b of m)this.looseRoutesById[b.routeId].options[v]?.(b)})})}})}catch(u){Vn(u)?(r=u,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):vn(u)&&(i=u);const c=r?r.status:i?404:this.stores.matches.get().some(f=>f.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(c),this.stores.redirect.set(r)})}this.latestLoadPromise===o&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),l()})}),this.latestLoadPromise=o,await o;this.latestLoadPromise&&o!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.stores.matches.get().some(l=>l.status==="error")&&(a=500),a!==void 0&&this.stores.statusCode.set(a)},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let i;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const o=this.latestLocation,s=this.stores.resolvedLocation.get(),a=typeof r.types=="function"?r.types(yu(o,s)):r.types;if(a===!1){n();return}i={update:n,types:a}}else i=n;document.startViewTransition(i)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const i=this.stores.pendingMatchStores.get(n);if(i){i.set(r);return}const o=this.stores.matchStores.get(n);if(o){o.set(r);return}const s=this.stores.cachedMatchStores.get(n);if(s){const a=r(s.get());a.status==="redirected"?this.stores.cachedMatchStores.delete(n)&&this.stores.cachedIds.set(l=>l.filter(u=>u!==n)):s.set(a)}})},this.getMatch=n=>this.stores.cachedMatchStores.get(n)?.get()??this.stores.pendingMatchStores.get(n)?.get()??this.stores.matchStores.get(n)?.get(),this.invalidate=n=>{const r=i=>n?.filter?.(i)??!0?{...i,invalid:!0,...n?.forcePending||i.status==="error"||i.status==="notFound"?{status:"pending",error:void 0}:void 0}:i;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(r)),this.stores.setCached(this.stores.cachedMatches.get().map(r)),this.stores.setPending(this.stores.pendingMatches.get().map(r))}),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const i=n.options._builtLocation??this.buildLocation(n.options),o=this.getParsedLocationHref(i);n.options.href=o,n.headers.set("Location",o)}else if(r)try{const i=new URL(r);if(this.origin&&i.origin===this.origin){const o=i.pathname+i.search+i.hash;n.options.href=o,n.headers.set("Location",o)}}catch{}if(n.options.href&&!n.options._builtLocation&&Rg(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(i=>!r(i))):this.stores.setCached([])},this.clearExpiredCache=()=>{const n=Date.now(),r=i=>{const o=this.looseRoutesById[i.routeId];if(!o.options.loader)return!0;const s=(i.preload?o.options.preloadGcTime??this.options.defaultPreloadGcTime:o.options.gcTime??this.options.defaultGcTime)??300*1e3;return i.status==="error"?!0:n-i.updatedAt>=s};this.clearCache({filter:r})},this.loadRouteChunk=$h,this.preloadRoute=async n=>{const r=n._builtLocation??this.buildLocation(n);let i=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const o=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),s=new Set([...o,...this.stores.cachedIds.get()]),a=i.filter(l=>!s.has(l.id));if(a.length){const l=this.stores.cachedMatches.get();this.stores.setCached([...l,...a])}try{return i=await VT({router:this,matches:i,location:r,preload:!0,updateMatch:(l,u)=>{o.has(l)?i=i.map(c=>c.id===l?u(c):c):this.updateMatch(l,u)}}),i}catch(l){if(Vn(l))return l.options.reloadDocument?void 0:await this.preloadRoute({...l.options,_fromLocation:r});vn(l)||console.error(l);return}},this.matchRoute=(n,r)=>{const i={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},o=this.buildLocation(i);if(r?.pending&&this.stores.status.get()!=="pending")return!1;const s=(r?.pending===void 0?!this.stores.isLoading.get():r.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=RV(o.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,s.pathname,this.processedTree);return!a||n.params&&!Ma(a.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?Ma(s.search,o.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(n=>n.status==="notFound"||n.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??eq,parseSearch:e.parseSearch??JV,protocolAllowlist:e.protocolAllowlist??TV}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=fB(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i}=n;let{matchedRoutes:o}=n,s=!1;(r?r.path!=="/"&&i["**"]:po(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:s=!0);const a=s?Sq(this.options.notFoundMode,o):void 0,l=new Array(o.length),u=new Map;for(const c of this.stores.matchStores.values())c.routeId&&u.set(c.routeId,c.get());for(let c=0;c<o.length;c++){const f=o[c],h=l[c-1];let d,p,m;{const E=h?.search??e.search,D=h?._strictSearch??void 0;try{const R=Km(f.options.validateSearch,{...E})??void 0;d={...E,...R},p={...D,...R},m=void 0}catch(R){let N=R;if(R instanceof $g||(N=new $g(R.message,{cause:R})),t?.throwOnError)throw N;d=E,p={},m=N}}const v=f.options.loaderDeps?.({search:d})??"",b=v?JSON.stringify(v):"",{interpolatedPath:y,usedParams:x}=$T({path:f.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),k=f.id+y+b,w=this.getMatch(k),S=u.get(f.id),O=w?._strictParams??x;let A;if(!w)try{XT(f,O)}catch(E){if(vn(E)||Vn(E)?A=E:A=new yq(E.message,{cause:E}),t?.throwOnError)throw A}Object.assign(i,O);const P=S?"stay":"enter";let M;if(w)M={...w,cause:P,params:S?.params??i,_strictParams:O,search:ea(S?S.search:w.search,d),_strictSearch:p};else{const E=f.options.loader||f.options.beforeLoad||f.lazyFn||vB(f)?"pending":"success";M={id:k,ssr:f.options.ssr,index:c,routeId:f.id,params:S?.params??i,_strictParams:O,pathname:y,updatedAt:Date.now(),search:S?ea(S.search,d):d,_strictSearch:p,searchError:void 0,status:E,isFetching:!1,error:void 0,paramsError:A,__routeContext:void 0,_nonReactive:{loadPromise:Fu()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:P,loaderDeps:S?os(S.loaderDeps,v):v,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:f.options.staticData||{},fullPath:f.fullPath}}t?.preload||(M.globalNotFound=a===f.id),M.searchError=m;const j=this.getParentContext(h);M.context={...j,...M.__routeContext,...M.__beforeLoadContext},l[c]=M}for(let c=0;c<l.length;c++){const f=l[c],h=this.looseRoutesById[f.routeId],d=this.getMatch(f.id),p=u.get(f.routeId);if(f.params=p?ea(p.params,i):i,!d){const m=l[c-1],v=this.getParentContext(m);if(h.options.context){const b={deps:f.loaderDeps,params:f.params,context:v??{},location:e,navigate:y=>this.navigate({...y,_fromLocation:e}),buildLocation:this.buildLocation,cause:f.cause,abortController:f.abortController,preload:!!f.preload,matches:l,routeId:h.id};f.__routeContext=h.options.context(b)??void 0}f.context={...v,...f.__routeContext,...f.__beforeLoadContext}}}return l}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:n}=this.getMatchedRoutes(e.pathname),r=Rh(t),i={...e.search};for(const u of t)try{Object.assign(i,Km(u.options.validateSearch,i))}catch{}const o=Rh(this.stores.matchesId.get()),s=o&&this.stores.matchStores.get(o)?.get(),a=s&&s.routeId===r.id&&s.pathname===e.pathname;let l;if(a)l=s.params;else{const u=Object.assign(Object.create(null),n);for(const c of t)try{XT(c,u)}catch{}l=u}return{matchedRoutes:t,fullPath:r.fullPath,search:i,params:l}}},$g=class extends Error{},yq=class extends Error{};function vq(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Km(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new $g("Async validation not supported");if(n.issues)throw new $g(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function bq({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),i=po(e);let o;const s=DV(i,n,!0);return s&&(o=s.route,Object.assign(r,s.rawParams)),{matchedRoutes:s?.branch||[t.__root__],routeParams:r,foundRoute:o}}function xq({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return wq(n)(e,t,r??!1)}function wq(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)i.options.search?.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const o=({search:s,next:a})=>{let l=s;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(l=i.options.preSearchFilters.reduce((c,f)=>f(c),s));const u=a(l);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((c,f)=>f(c),u):u};t.middlewares.push(o)}if(i.options.validateSearch){const o=({search:s,next:a})=>{const l=a(s);if(!t._includeValidateSearch)return l;try{return{...l,...Km(i.options.validateSearch,l)??void 0}}catch{return l}};t.middlewares.push(o)}}const n=({search:i})=>{const o=t.dest;return o.search?o.search===!0?i:is(o.search,i):{}};t.middlewares.push(n);const r=(i,o,s)=>{if(i>=s.length)return o;const a=s[i];return a({search:o,next:u=>r(i+1,u,s)})};return function(o,s,a){return t.dest=s,t._includeValidateSearch=a,r(0,o,t.middlewares)}}function Sq(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return Ia}function XT(e,t){const n=e.options.params?.parse??e.options.parseParams;if(n){const r=n(t);if(r===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(t,r)}}const kq="Error preloading route! ☝️";var bB=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{this.originalIndex=t.originalIndex;const n=this.options,r=!n?.path&&!n?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=Ia:this.parentRoute||vo();let i=r?Ia:n?.path;i&&i!=="/"&&(i=hB(i));const o=n?.id||i;let s=r?Ia:Vm([this.parentRoute.id==="__root__"?"":this.parentRoute.id,o]);i==="__root__"&&(i="/"),s!=="__root__"&&(s=Vm(["/",s]));const a=s==="__root__"?"/":Vm([this.parentRoute.fullPath,i]);this._path=i,this._id=s,this._fullPath=a,this._to=po(a)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>rq({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},Oq=class extends bB{constructor(e){super(e)}};function Cq(e){if(typeof document<"u"&&document.querySelector){const t=e.stores.location.get(),n=t.state.__hashScrollIntoViewOptions??!0;if(n&&t.hash!==""){const r=document.getElementById(t.hash);r&&r.scrollIntoView(n)}}}function UC(e){const t=e.errorComponent??HC;return g.jsx(Aq,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?C.createElement(t,{error:n,reset:r}):e.children})}var Aq=class extends C.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){const n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function HC({error:e}){const[t,n]=C.useState(!1);return g.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[g.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),g.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),g.jsx("div",{style:{height:".25rem"}}),t?g.jsx("div",{children:g.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?g.jsx("code",{children:e.message}):null})}):null]})}function Pq({children:e,fallback:t=null}){return xB()?g.jsx(L.Fragment,{children:e}):g.jsx(L.Fragment,{children:t})}function xB(){return L.useSyncExternalStore(Eq,()=>!0,()=>!1)}function Eq(){return()=>{}}var wB=C.createContext(null);function Tr(e){return C.useContext(wB)}var Qv=C.createContext(void 0),Tq=C.createContext(void 0),pt=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(pt||{});function _q({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:o,checkDirty:s,shallowPropagate:a};function r(u,c,f){const h=c.depsTail;if(h!==void 0&&h.dep===u)return;const d=h!==void 0?h.nextDep:c.deps;if(d!==void 0&&d.dep===u){d.version=f,c.depsTail=d;return}const p=u.subsTail;if(p!==void 0&&p.version===f&&p.sub===c)return;const m=c.depsTail=u.subsTail={version:f,dep:u,sub:c,prevDep:h,nextDep:d,prevSub:p,nextSub:void 0};d!==void 0&&(d.prevDep=m),h!==void 0?h.nextDep=m:c.deps=m,p!==void 0?p.nextSub=m:u.subs=m}function i(u,c=u.sub){const f=u.dep,h=u.prevDep,d=u.nextDep,p=u.nextSub,m=u.prevSub;return d!==void 0?d.prevDep=h:c.depsTail=h,h!==void 0?h.nextDep=d:c.deps=d,p!==void 0?p.prevSub=m:f.subsTail=m,m!==void 0?m.nextSub=p:(f.subs=p)===void 0&&n(f),d}function o(u){let c=u.nextSub,f;e:do{const h=u.sub;let d=h.flags;if(d&60?d&12?d&4?!(d&48)&&l(u,h)?(h.flags=d|40,d&=1):d=0:h.flags=d&-9|32:d=0:h.flags=d|32,d&2&&t(h),d&1){const p=h.subs;if(p!==void 0){const m=(u=p).nextSub;m!==void 0&&(f={value:c,prev:f},c=m);continue}}if((u=c)!==void 0){c=u.nextSub;continue}for(;f!==void 0;)if(u=f.value,f=f.prev,u!==void 0){c=u.nextSub;continue e}break}while(!0)}function s(u,c){let f,h=0,d=!1;e:do{const p=u.dep,m=p.flags;if(c.flags&16)d=!0;else if((m&17)===17){if(e(p)){const v=p.subs;v.nextSub!==void 0&&a(v),d=!0}}else if((m&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(f={value:u,prev:f}),u=p.deps,c=p,++h;continue}if(!d){const v=u.nextDep;if(v!==void 0){u=v;continue}}for(;h--;){const v=c.subs,b=v.nextSub!==void 0;if(b?(u=f.value,f=f.prev):u=v,d){if(e(c)){b&&a(v),c=u.sub;continue}d=!1}else c.flags&=-33;c=u.sub;const y=u.nextDep;if(y!==void 0){u=y;continue e}}return d}while(!0)}function a(u){do{const c=u.sub,f=c.flags;(f&48)===32&&(c.flags=f|16,(f&6)===2&&t(c))}while((u=u.nextSub)!==void 0)}function l(u,c){let f=c.depsTail;for(;f!==void 0;){if(f===u)return!0;f=f.prevDep}return!1}}function jq(e,t,n){const r=typeof e=="object",i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}const Bw=[];let Gm=0;const{link:YT,unlink:Mq,propagate:Iq,checkDirty:SB,shallowPropagate:ZT}=_q({update(e){return e._update()},notify(e){Bw[Fw++]=e,e.flags&=~pt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=pt.Mutable|pt.Dirty,Bg(e))}});let Lp=0,Fw=0,Ti,zw=0;function kB(e){try{++zw,e()}finally{--zw||OB()}}function Bg(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=Mq(n,e)}function OB(){if(!(zw>0)){for(;Lp<Fw;){const e=Bw[Lp];Bw[Lp++]=void 0,e.notify()}Lp=0,Fw=0}}function JT(e,t){const n=typeof e=="function",r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?pt.None:pt.Mutable,get(){return Ti!==void 0&&YT(i,Ti,Gm),i._snapshot},subscribe(o){const s=jq(o),a={current:!1},l=Nq(()=>{i.get(),a.current?s.next?.(i._snapshot):a.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(o){const s=Ti,a=t?.compare??Object.is;if(n)Ti=i,++Gm,i.depsTail=void 0;else if(o===void 0)return!1;n&&(i.flags=pt.Mutable|pt.RecursedCheck);try{const l=i._snapshot,u=typeof o=="function"?o(l):o===void 0&&n?r(l):o;return l===void 0||!a(l,u)?(i._snapshot=u,!0):!1}finally{Ti=s,n&&(i.flags&=~pt.RecursedCheck),Bg(i)}}};return n?(i.flags=pt.Mutable|pt.Dirty,i.get=function(){const o=i.flags;if(o&pt.Dirty||o&pt.Pending&&SB(i.deps,i)){if(i._update()){const s=i.subs;s!==void 0&&ZT(s)}}else o&pt.Pending&&(i.flags=o&~pt.Pending);return Ti!==void 0&&YT(i,Ti,Gm),i._snapshot}):i.set=function(o){if(i._update(o)){const s=i.subs;s!==void 0&&(Iq(s),ZT(s),OB())}},i}function Nq(e){const t=()=>{const r=Ti;Ti=n,++Gm,n.depsTail=void 0,n.flags=pt.Watching|pt.RecursedCheck;try{return e()}finally{Ti=r,n.flags&=~pt.RecursedCheck,Bg(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:pt.Watching|pt.RecursedCheck,notify(){const r=this.flags;r&pt.Dirty||r&pt.Pending&&SB(this.deps,this)?t():this.flags=pt.Watching},stop(){this.flags=pt.None,this.depsTail=void 0,Bg(this)}};return t(),n}var CB={exports:{}},AB={},PB={exports:{}},EB={};/**
|
|
41
|
-
* @license React
|
|
42
|
-
* use-sync-external-store-shim.production.js
|
|
43
|
-
*
|
|
44
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
45
|
-
*
|
|
46
|
-
* This source code is licensed under the MIT license found in the
|
|
47
|
-
* LICENSE file in the root directory of this source tree.
|
|
48
|
-
*/var zu=C;function Rq(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Dq=typeof Object.is=="function"?Object.is:Rq,Lq=zu.useState,$q=zu.useEffect,Bq=zu.useLayoutEffect,Fq=zu.useDebugValue;function zq(e,t){var n=t(),r=Lq({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return Bq(function(){i.value=n,i.getSnapshot=t,tx(i)&&o({inst:i})},[e,n,t]),$q(function(){return tx(i)&&o({inst:i}),e(function(){tx(i)&&o({inst:i})})},[e]),Fq(n),n}function tx(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Dq(e,n)}catch{return!0}}function Wq(e,t){return t()}var Uq=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Wq:zq;EB.useSyncExternalStore=zu.useSyncExternalStore!==void 0?zu.useSyncExternalStore:Uq;PB.exports=EB;var Hq=PB.exports;/**
|
|
49
|
-
* @license React
|
|
50
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
51
|
-
*
|
|
52
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the MIT license found in the
|
|
55
|
-
* LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/var Xv=C,Vq=Hq;function qq(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Kq=typeof Object.is=="function"?Object.is:qq,Gq=Vq.useSyncExternalStore,Qq=Xv.useRef,Xq=Xv.useEffect,Yq=Xv.useMemo,Zq=Xv.useDebugValue;AB.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=Qq(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=Yq(function(){function l(d){if(!u){if(u=!0,c=d,d=r(d),i!==void 0&&s.hasValue){var p=s.value;if(i(p,d))return f=p}return f=d}if(p=f,Kq(c,d))return p;var m=r(d);return i!==void 0&&i(p,m)?(c=d,p):(c=d,f=m)}var u=!1,c,f,h=n===void 0?null:n;return[function(){return l(t())},h===null?void 0:function(){return l(h())}]},[t,n,r,i]);var a=Gq(e,o[0],o[1]);return Xq(function(){s.hasValue=!0,s.value=a},[a]),Zq(a),a};CB.exports=AB;var Jq=CB.exports;function eK(e,t){return e===t}function er(e,t,n=eK){const r=C.useCallback(s=>{if(!e)return()=>{};const{unsubscribe:a}=e.subscribe(s);return a},[e]),i=C.useCallback(()=>e?.get(),[e]);return Jq.useSyncExternalStoreWithSelector(r,i,i,t,n)}var tK={get:()=>{},subscribe:()=>({unsubscribe:()=>{}})};function ul(e){const t=Tr(),n=C.useContext(e.from?Tq:Qv),r=e.from??n,i=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,o=C.useRef(void 0);return er(i??tK,s=>{if((e.shouldThrow??!0)&&!s&&vo(),s===void 0)return;const a=e.select?e.select(s):s;if(e.structuralSharing??t.options.defaultStructuralSharing){const l=os(o.current,a);return o.current=l,l}return a})}function TB(e){return ul({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function _B(e){const{select:t,...n}=e;return ul({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Pc(e){return ul({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Ec(e){return ul({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function _r(e){const t=Tr();return C.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function jB(e){return ul({...e,select:t=>e.select?e.select(t.context):t.context})}function nK(e,t){const n=Tr(),r=CV(t),{activeProps:i,inactiveProps:o,activeOptions:s,to:a,preload:l,preloadDelay:u,preloadIntentProximity:c,hashScrollIntoView:f,replace:h,startTransition:d,resetScroll:p,viewTransition:m,children:v,target:b,disabled:y,style:x,className:k,onClick:w,onBlur:S,onFocus:O,onMouseEnter:A,onMouseLeave:P,onTouchStart:M,ignoreBlocker:j,params:E,search:D,hash:R,state:N,mask:B,reloadDocument:F,unsafeRelative:$,from:z,_fromLocation:T,...q}=e,I=xB(),_=C.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),K=er(n.stores.location,Ue=>Ue,(Ue,U)=>Ue.href===U.href),Q=C.useMemo(()=>{const Ue={_fromLocation:K,..._};return n.buildLocation(Ue)},[n,K,_]),te=Q.maskedLocation?Q.maskedLocation.publicHref:Q.publicHref,he=Q.maskedLocation?Q.maskedLocation.external:Q.external,ve=C.useMemo(()=>lK(te,he,n.history,y),[y,he,te,n.history]),X=C.useMemo(()=>{if(ve?.external)return Rg(ve.href,n.protocolAllowlist)?void 0:ve.href;if(!uK(a)&&!(typeof a!="string"||a.indexOf(":")===-1))try{return new URL(a),Rg(a,n.protocolAllowlist)?void 0:a}catch{}},[a,ve,n.protocolAllowlist]),ue=C.useMemo(()=>{if(X)return!1;if(s?.exact){if(!WV(K.pathname,Q.pathname,n.basepath))return!1}else{const Ue=Dg(K.pathname,n.basepath),U=Dg(Q.pathname,n.basepath);if(!(Ue.startsWith(U)&&(Ue.length===U.length||Ue[U.length]==="/")))return!1}return(s?.includeSearch??!0)&&!Ma(K.search,Q.search,{partial:!s?.exact,ignoreUndefined:!s?.explicitUndefined})?!1:s?.includeHash?I&&K.hash===Q.hash:!0},[s?.exact,s?.explicitUndefined,s?.includeHash,s?.includeSearch,K,X,I,Q.hash,Q.pathname,Q.search,n.basepath]),ge=ue?is(i,{})??rK:nx,Y=ue?nx:is(o,{})??nx,Qe=[k,ge.className,Y.className].filter(Boolean).join(" "),Pe=(x||ge.style||Y.style)&&{...x,...ge.style,...Y.style},[dt,at]=C.useState(!1),Mt=C.useRef(!1),nn=e.reloadDocument||X?!1:l??n.options.defaultPreload,or=u??n.options.defaultPreloadDelay??0,Cn=C.useCallback(()=>{n.preloadRoute({..._,_builtLocation:Q}).catch(Ue=>{console.warn(Ue),console.warn(kq)})},[n,_,Q]);OV(r,C.useCallback(Ue=>{Ue?.isIntersecting&&Cn()},[Cn]),aK,{disabled:!!y||nn!=="viewport"}),C.useEffect(()=>{Mt.current||!y&&nn==="render"&&(Cn(),Mt.current=!0)},[y,Cn,nn]);const Jr=Ue=>{const U=Ue.currentTarget.getAttribute("target"),ee=b!==void 0?b:U;if(!y&&!cK(Ue)&&!Ue.defaultPrevented&&(!ee||ee==="_self")&&Ue.button===0){Ue.preventDefault(),ll.flushSync(()=>{at(!0)});const be=n.subscribe("onResolved",()=>{be(),at(!1)});n.navigate({..._,replace:h,resetScroll:p,hashScrollIntoView:f,startTransition:d,viewTransition:m,ignoreBlocker:j})}};if(X)return{...q,ref:r,href:X,...v&&{children:v},...b&&{target:b},...y&&{disabled:y},...x&&{style:x},...k&&{className:k},...w&&{onClick:w},...S&&{onBlur:S},...O&&{onFocus:O},...A&&{onMouseEnter:A},...P&&{onMouseLeave:P},...M&&{onTouchStart:M}};const jr=Ue=>{if(y||nn!=="intent")return;if(!or){Cn();return}const U=Ue.currentTarget;if(uf.has(U))return;const ee=setTimeout(()=>{uf.delete(U),Cn()},or);uf.set(U,ee)},Ys=Ue=>{y||nn!=="intent"||Cn()},Zs=Ue=>{if(y||!nn||!or)return;const U=Ue.currentTarget,ee=uf.get(U);ee&&(clearTimeout(ee),uf.delete(U))};return{...q,...ge,...Y,href:ve?.href,ref:r,onClick:Sl([w,Jr]),onBlur:Sl([S,Zs]),onFocus:Sl([O,jr]),onMouseEnter:Sl([A,jr]),onMouseLeave:Sl([P,Zs]),onTouchStart:Sl([M,Ys]),disabled:!!y,target:b,...Pe&&{style:Pe},...Qe&&{className:Qe},...y&&iK,...ue&&oK,...I&&dt&&sK}}var nx={},rK={className:"active"},iK={role:"link","aria-disabled":!0},oK={"data-status":"active","aria-current":"page"},sK={"data-transitioning":"transitioning"},uf=new WeakMap,aK={rootMargin:"100px"},Sl=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function lK(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function uK(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var vt=C.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,...o}=nK(r,t),s=typeof r.children=="function"?r.children({isActive:o["data-status"]==="active"}):r.children;if(!n){const{disabled:a,...l}=o;return C.createElement("a",l,s)}return C.createElement(n,o,s)});function cK(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var fK=class extends bB{constructor(e){super(e),this.useMatch=t=>ul({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>jB({...t,from:this.id}),this.useSearch=t=>Ec({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Pc({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>_B({...t,from:this.id}),this.useLoaderData=t=>TB({...t,from:this.id}),this.useNavigate=()=>_r({from:this.fullPath}),this.Link=L.forwardRef((t,n)=>g.jsx(vt,{ref:n,from:this.fullPath,...t}))}};function cl(e){return new fK(e)}var hK=class extends Oq{constructor(e){super(e),this.useMatch=t=>ul({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>jB({...t,from:this.id}),this.useSearch=t=>Ec({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Pc({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>_B({...t,from:this.id}),this.useLoaderData=t=>TB({...t,from:this.id}),this.useNavigate=()=>_r({from:this.fullPath}),this.Link=L.forwardRef((t,n)=>g.jsx(vt,{ref:n,from:this.fullPath,...t}))}};function dK(e){return new hK(e)}function pK(e){const t=Tr(),n=`not-found-${er(t.stores.location,r=>r.pathname)}-${er(t.stores.status,r=>r)}`;return g.jsx(UC,{getResetKey:()=>n,onCatch:(r,i)=>{if(vn(r))e.onCatch?.(r,i);else throw r},errorComponent:({error:r})=>{if(vn(r))return e.fallback?.(r);throw r},children:e.children})}function mK(){return g.jsx("p",{children:"Not Found"})}function Il(e){return g.jsx(g.Fragment,{children:e.children})}function MB(e,t,n){return t.options.notFoundComponent?g.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?g.jsx(e.options.defaultNotFoundComponent,{...n}):g.jsx(mK,{})}function gK(e){return null}function yK(){return gK(Tr()),null}var IB=C.memo(function({matchId:t}){const n=Tr(),r=n.stores.matchStores.get(t);r||vo();const i=er(n.stores.loadedAt,s=>s),o=er(r,s=>s);return g.jsx(vK,{router:n,matchId:t,resetKey:i,matchState:C.useMemo(()=>{const s=o.routeId,a=n.routesById[s].parentRoute?.id;return{routeId:s,ssr:o.ssr,_displayPending:o._displayPending,parentRouteId:a}},[o._displayPending,o.routeId,o.ssr,n.routesById])})});function vK({router:e,matchId:t,resetKey:n,matchState:r}){const i=e.routesById[r.routeId],o=i.options.pendingComponent??e.options.defaultPendingComponent,s=o?g.jsx(o,{}):null,a=i.options.errorComponent??e.options.defaultErrorComponent,l=i.options.onCatch??e.options.defaultOnCatch,u=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,c=r.ssr===!1||r.ssr==="data-only",f=(!i.isRoot||i.options.wrapInSuspense||c)&&(i.options.wrapInSuspense??o??(i.options.errorComponent?.preload||c))?C.Suspense:Il,h=a?UC:Il,d=u?pK:Il;return g.jsxs(i.isRoot?i.options.shellComponent??Il:Il,{children:[g.jsx(Qv.Provider,{value:t,children:g.jsx(f,{fallback:s,children:g.jsx(h,{getResetKey:()=>n,errorComponent:a||HC,onCatch:(p,m)=>{if(vn(p))throw p.routeId??=r.routeId,p;l?.(p,m)},children:g.jsx(d,{fallback:p=>{if(p.routeId??=r.routeId,!u||p.routeId&&p.routeId!==r.routeId||!p.routeId&&!i.isRoot)throw p;return C.createElement(u,p)},children:c||r._displayPending?g.jsx(Pq,{fallback:s,children:g.jsx(e2,{matchId:t})}):g.jsx(e2,{matchId:t})})})})}),r.parentRouteId===Ia?g.jsxs(g.Fragment,{children:[g.jsx(bK,{resetKey:n}),e.options.scrollRestoration&&oB?g.jsx(yK,{}):null]}):null]})}function bK({resetKey:e}){const t=Tr(),n=C.useRef(void 0);return Rf(()=>{const r=t.latestLocation.href;(n.current===void 0||n.current!==r)&&(t.emit({type:"onRendered",...yu(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=r)},[t.latestLocation.state.__TSR_key,e,t]),null}var e2=C.memo(function({matchId:t}){const n=Tr(),r=(c,f)=>n.getMatch(c.id)?._nonReactive[f]??c._nonReactive[f],i=n.stores.matchStores.get(t);i||vo();const o=er(i,c=>c),s=o.routeId,a=n.routesById[s],l=C.useMemo(()=>{const c=(n.routesById[s].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:s,loaderDeps:o.loaderDeps,params:o._strictParams,search:o._strictSearch});return c?JSON.stringify(c):void 0},[s,o.loaderDeps,o._strictParams,o._strictSearch,n.options.defaultRemountDeps,n.routesById]),u=C.useMemo(()=>{const c=a.options.component??n.options.defaultComponent;return c?g.jsx(c,{},l):g.jsx(NB,{})},[l,a.options.component,n.options.defaultComponent]);if(o._displayPending)throw r(o,"displayPendingPromise");if(o._forcePending)throw r(o,"minPendingPromise");if(o.status==="pending"){const c=a.options.pendingMinMs??n.options.defaultPendingMinMs;if(c){const f=n.getMatch(o.id);if(f&&!f._nonReactive.minPendingPromise){const h=Fu();f._nonReactive.minPendingPromise=h,setTimeout(()=>{h.resolve(),f._nonReactive.minPendingPromise=void 0},c)}}throw r(o,"loadPromise")}if(o.status==="notFound")return vn(o.error)||vo(),MB(n,a,o.error);if(o.status==="redirected")throw Vn(o.error)||vo(),r(o,"loadPromise");if(o.status==="error")throw o.error;return u}),NB=C.memo(function(){const t=Tr(),n=C.useContext(Qv);let r,i=!1,o;{const u=n?t.stores.matchStores.get(n):void 0;[r,i]=er(u,c=>[c?.routeId,c?.globalNotFound??!1]),o=er(t.stores.matchesId,c=>c[c.findIndex(f=>f===n)+1])}const s=r?t.routesById[r]:void 0,a=t.options.defaultPendingComponent?g.jsx(t.options.defaultPendingComponent,{}):null;if(i)return s||vo(),MB(t,s,void 0);if(!o)return null;const l=g.jsx(IB,{matchId:o});return r===Ia?g.jsx(C.Suspense,{fallback:a,children:l}):l});function xK(){const e=Tr(),t=C.useRef({router:e,mounted:!1}),[n,r]=C.useState(!1),i=er(e.stores.isLoading,f=>f),o=er(e.stores.hasPending,f=>f),s=Gb(i),a=i||n||o,l=Gb(a),u=i||o,c=Gb(u);return e.startTransition=f=>{r(!0),C.startTransition(()=>{f(),r(!1)})},C.useEffect(()=>{const f=e.history.subscribe(e.load),h=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return po(e.latestLocation.publicHref)!==po(h.publicHref)&&e.commitLocation({...h,replace:!0}),()=>{f()}},[e,e.history]),Rf(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(h){console.error(h)}})()},[e]),Rf(()=>{s&&!i&&e.emit({type:"onLoad",...yu(e.stores.location.get(),e.stores.resolvedLocation.get())})},[s,e,i]),Rf(()=>{c&&!u&&e.emit({type:"onBeforeRouteMount",...yu(e.stores.location.get(),e.stores.resolvedLocation.get())})},[u,c,e]),Rf(()=>{if(l&&!a){const f=yu(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...f}),kB(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())}),f.hrefChanged&&Cq(e)}},[a,l,e]),null}function wK(){const e=Tr(),t=e.routesById[Ia].options.pendingComponent??e.options.defaultPendingComponent,n=t?g.jsx(t,{}):null,r=g.jsxs(typeof document<"u"&&e.ssr?Il:C.Suspense,{fallback:n,children:[g.jsx(xK,{}),g.jsx(SK,{})]});return e.options.InnerWrap?g.jsx(e.options.InnerWrap,{children:r}):r}function SK(){const e=Tr(),t=er(e.stores.firstId,i=>i),n=er(e.stores.loadedAt,i=>i),r=t?g.jsx(IB,{matchId:t}):null;return g.jsx(Qv.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:g.jsx(UC,{getResetKey:()=>n,errorComponent:HC,onCatch:void 0,children:r})})}function kK(e){const t=Tr(),n=C.useRef(void 0);return er(t.stores.matches,r=>{const i=r;if(t.options.defaultStructuralSharing){const o=os(n.current,i);return n.current=o,o}return i})}var OK=e=>({createMutableStore:JT,createReadonlyStore:JT,batch:kB}),CK=e=>new AK(e),AK=class extends gq{constructor(e){super(e,OK)}};function PK({router:e,children:t,...n}){aB(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=g.jsx(wB.Provider,{value:e,children:t});return e.options.Wrap?g.jsx(e.options.Wrap,{children:r}):r}function EK({router:e,...t}){return g.jsx(PK,{router:e,...t,children:g.jsx(wK,{})})}const Ww="squad.console.token";function TK(){const e=new URL(window.location.href),t=e.searchParams.get("t");return t?(sessionStorage.setItem(Ww,t),e.searchParams.delete("t"),window.history.replaceState({},"",e.toString()),t):sessionStorage.getItem(Ww)}class kr extends Error{constructor(){super("Session token missing or invalid. Reopen squad console."),this.name="UnauthorizedError"}}async function Me(e,t){const n=sessionStorage.getItem(Ww);if(!n)throw new kr;const r=await fetch(e,{...t,headers:{"content-type":"application/json",authorization:`Bearer ${n}`,...t?.headers??{}}});if(r.status===401)throw new kr;if(!r.ok){const i=await _K(r);throw new Error(`${r.status} ${r.statusText}: ${i}`)}return await r.json()}async function _K(e){try{return(await e.text()).slice(0,400)}catch{return""}}var t2=1,jK=.9,MK=.8,IK=.17,rx=.1,ix=.999,NK=.9999,RK=.99,DK=/[\\\/_+.#"@\[\(\{&]/,LK=/[\\\/_+.#"@\[\(\{&]/g,$K=/[\s-]/,RB=/[\s-]/g;function Uw(e,t,n,r,i,o,s){if(o===t.length)return i===e.length?t2:RK;var a=`${i},${o}`;if(s[a]!==void 0)return s[a];for(var l=r.charAt(o),u=n.indexOf(l,i),c=0,f,h,d,p;u>=0;)f=Uw(e,t,n,r,u+1,o+1,s),f>c&&(u===i?f*=t2:DK.test(e.charAt(u-1))?(f*=MK,d=e.slice(i,u-1).match(LK),d&&i>0&&(f*=Math.pow(ix,d.length))):$K.test(e.charAt(u-1))?(f*=jK,p=e.slice(i,u-1).match(RB),p&&i>0&&(f*=Math.pow(ix,p.length))):(f*=IK,i>0&&(f*=Math.pow(ix,u-i))),e.charAt(u)!==t.charAt(o)&&(f*=NK)),(f<rx&&n.charAt(u-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(u-1)!==r.charAt(o))&&(h=Uw(e,t,n,r,u+1,o+2,s),h*rx>f&&(f=h*rx)),f>c&&(c=f),u=n.indexOf(l,u+1);return s[a]=c,c}function n2(e){return e.toLowerCase().replace(RB," ")}function BK(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Uw(e,t,n2(e),n2(t),0,0,{})}function ws(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function r2(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Es(...e){return t=>{let n=!1;const r=e.map(i=>{const o=r2(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():r2(e[i],null)}}}}function fl(...e){return C.useCallback(Es(...e),e)}function FK(e,t){const n=C.createContext(t),r=o=>{const{children:s,...a}=o,l=C.useMemo(()=>a,Object.values(a));return g.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function i(o){const s=C.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function zK(e,t=[]){let n=[];function r(o,s){const a=C.createContext(s),l=n.length;n=[...n,s];const u=f=>{const{scope:h,children:d,...p}=f,m=h?.[e]?.[l]||a,v=C.useMemo(()=>p,Object.values(p));return g.jsx(m.Provider,{value:v,children:d})};u.displayName=o+"Provider";function c(f,h){const d=h?.[e]?.[l]||a,p=C.useContext(d);if(p)return p;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[u,c]}const i=()=>{const o=n.map(s=>C.createContext(s));return function(a){const l=a?.[e]||o;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,WK(i,...t)]}function WK(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const f=l(o)[`__scope${u}`];return{...a,...f}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var Bh=globalThis?.document?C.useLayoutEffect:()=>{},UK=HO[" useId ".trim().toString()]||(()=>{}),HK=0;function bo(e){const[t,n]=C.useState(UK());return Bh(()=>{n(r=>r??String(HK++))},[e]),t?`radix-${t}`:""}var VK=HO[" useInsertionEffect ".trim().toString()]||Bh;function qK({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,s]=KK({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:i;{const c=C.useRef(e!==void 0);C.useEffect(()=>{const f=c.current;f!==a&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),c.current=a},[a,r])}const u=C.useCallback(c=>{if(a){const f=GK(c)?c(e):c;f!==e&&s.current?.(f)}else o(c)},[a,e,o,s]);return[l,u]}function KK({defaultProp:e,onChange:t}){const[n,r]=C.useState(e),i=C.useRef(n),o=C.useRef(t);return VK(()=>{o.current=t},[t]),C.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function GK(e){return typeof e=="function"}function DB(e){const t=QK(e),n=C.forwardRef((r,i)=>{const{children:o,...s}=r,a=C.Children.toArray(o),l=a.find(YK);if(l){const u=l.props.children,c=a.map(f=>f===l?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:f);return g.jsx(t,{...s,ref:i,children:C.isValidElement(u)?C.cloneElement(u,void 0,c):null})}return g.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function QK(e){const t=C.forwardRef((n,r)=>{const{children:i,...o}=n;if(C.isValidElement(i)){const s=JK(i),a=ZK(o,i.props);return i.type!==C.Fragment&&(a.ref=r?Es(r,s):s),C.cloneElement(i,a)}return C.Children.count(i)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var XK=Symbol("radix.slottable");function YK(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===XK}function ZK(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{const l=o(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function JK(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var eG=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$o=eG.reduce((e,t)=>{const n=DB(`Primitive.${t}`),r=C.forwardRef((i,o)=>{const{asChild:s,...a}=i,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(l,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function tG(e,t){e&&ll.flushSync(()=>e.dispatchEvent(t))}function Fh(e){const t=C.useRef(e);return C.useEffect(()=>{t.current=e}),C.useMemo(()=>(...n)=>t.current?.(...n),[])}function nG(e,t=globalThis?.document){const n=Fh(e);C.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var rG="DismissableLayer",Hw="dismissableLayer.update",iG="dismissableLayer.pointerDownOutside",oG="dismissableLayer.focusOutside",i2,LB=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$B=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...l}=e,u=C.useContext(LB),[c,f]=C.useState(null),h=c?.ownerDocument??globalThis?.document,[,d]=C.useState({}),p=fl(t,O=>f(O)),m=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(v),y=c?m.indexOf(c):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,k=y>=b,w=lG(O=>{const A=O.target,P=[...u.branches].some(M=>M.contains(A));!k||P||(i?.(O),s?.(O),O.defaultPrevented||a?.())},h),S=uG(O=>{const A=O.target;[...u.branches].some(M=>M.contains(A))||(o?.(O),s?.(O),O.defaultPrevented||a?.())},h);return nG(O=>{y===u.layers.size-1&&(r?.(O),!O.defaultPrevented&&a&&(O.preventDefault(),a()))},h),C.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(i2=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),o2(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=i2)}},[c,h,n,u]),C.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),o2())},[c,u]),C.useEffect(()=>{const O=()=>d({});return document.addEventListener(Hw,O),()=>document.removeEventListener(Hw,O)},[]),g.jsx($o.div,{...l,ref:p,style:{pointerEvents:x?k?"auto":"none":void 0,...e.style},onFocusCapture:ws(e.onFocusCapture,S.onFocusCapture),onBlurCapture:ws(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:ws(e.onPointerDownCapture,w.onPointerDownCapture)})});$B.displayName=rG;var sG="DismissableLayerBranch",aG=C.forwardRef((e,t)=>{const n=C.useContext(LB),r=C.useRef(null),i=fl(t,r);return C.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),g.jsx($o.div,{...e,ref:i})});aG.displayName=sG;function lG(e,t=globalThis?.document){const n=Fh(e),r=C.useRef(!1),i=C.useRef(()=>{});return C.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let l=function(){BB(iG,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function uG(e,t=globalThis?.document){const n=Fh(e),r=C.useRef(!1);return C.useEffect(()=>{const i=o=>{o.target&&!r.current&&BB(oG,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function o2(){const e=new CustomEvent(Hw);document.dispatchEvent(e)}function BB(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?tG(i,o):i.dispatchEvent(o)}var ox="focusScope.autoFocusOnMount",sx="focusScope.autoFocusOnUnmount",s2={bubbles:!1,cancelable:!0},cG="FocusScope",FB=C.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,l]=C.useState(null),u=Fh(i),c=Fh(o),f=C.useRef(null),h=fl(t,m=>l(m)),d=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(r){let m=function(x){if(d.paused||!a)return;const k=x.target;a.contains(k)?f.current=k:Vo(f.current,{select:!0})},v=function(x){if(d.paused||!a)return;const k=x.relatedTarget;k!==null&&(a.contains(k)||Vo(f.current,{select:!0}))},b=function(x){if(document.activeElement===document.body)for(const w of x)w.removedNodes.length>0&&Vo(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const y=new MutationObserver(b);return a&&y.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),y.disconnect()}}},[r,a,d.paused]),C.useEffect(()=>{if(a){l2.add(d);const m=document.activeElement;if(!a.contains(m)){const b=new CustomEvent(ox,s2);a.addEventListener(ox,u),a.dispatchEvent(b),b.defaultPrevented||(fG(gG(zB(a)),{select:!0}),document.activeElement===m&&Vo(a))}return()=>{a.removeEventListener(ox,u),setTimeout(()=>{const b=new CustomEvent(sx,s2);a.addEventListener(sx,c),a.dispatchEvent(b),b.defaultPrevented||Vo(m??document.body,{select:!0}),a.removeEventListener(sx,c),l2.remove(d)},0)}}},[a,u,c,d]);const p=C.useCallback(m=>{if(!n&&!r||d.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(v&&b){const y=m.currentTarget,[x,k]=hG(y);x&&k?!m.shiftKey&&b===k?(m.preventDefault(),n&&Vo(x,{select:!0})):m.shiftKey&&b===x&&(m.preventDefault(),n&&Vo(k,{select:!0})):b===y&&m.preventDefault()}},[n,r,d.paused]);return g.jsx($o.div,{tabIndex:-1,...s,ref:h,onKeyDown:p})});FB.displayName=cG;function fG(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Vo(r,{select:t}),document.activeElement!==n)return}function hG(e){const t=zB(e),n=a2(t,e),r=a2(t.reverse(),e);return[n,r]}function zB(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function a2(e,t){for(const n of e)if(!dG(n,{upTo:t}))return n}function dG(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function pG(e){return e instanceof HTMLInputElement&&"select"in e}function Vo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&pG(e)&&t&&e.select()}}var l2=mG();function mG(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=u2(e,t),e.unshift(t)},remove(t){e=u2(e,t),e[0]?.resume()}}}function u2(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function gG(e){return e.filter(t=>t.tagName!=="A")}var yG="Portal",WB=C.forwardRef((e,t)=>{const{container:n,...r}=e,[i,o]=C.useState(!1);Bh(()=>o(!0),[]);const s=n||i&&globalThis?.document?.body;return s?B7.createPortal(g.jsx($o.div,{...r,ref:t}),s):null});WB.displayName=yG;function vG(e,t){return C.useReducer((n,r)=>t[n][r]??n,e)}var Yv=e=>{const{present:t,children:n}=e,r=bG(t),i=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),o=fl(r.ref,xG(i));return typeof n=="function"||r.isPresent?C.cloneElement(i,{ref:o}):null};Yv.displayName="Presence";function bG(e){const[t,n]=C.useState(),r=C.useRef(null),i=C.useRef(e),o=C.useRef("none"),s=e?"mounted":"unmounted",[a,l]=vG(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const u=$p(r.current);o.current=a==="mounted"?u:"none"},[a]),Bh(()=>{const u=r.current,c=i.current;if(c!==e){const h=o.current,d=$p(u);e?l("MOUNT"):d==="none"||u?.display==="none"?l("UNMOUNT"):l(c&&h!==d?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Bh(()=>{if(t){let u;const c=t.ownerDocument.defaultView??window,f=d=>{const m=$p(r.current).includes(CSS.escape(d.animationName));if(d.target===t&&m&&(l("ANIMATION_END"),!i.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},h=d=>{d.target===t&&(o.current=$p(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:C.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function $p(e){return e?.animationName||"none"}function xG(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ax=0;function wG(){C.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??c2()),document.body.insertAdjacentElement("beforeend",e[1]??c2()),ax++,()=>{ax===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ax--}},[])}function c2(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ji=function(){return ji=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ji.apply(this,arguments)};function UB(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function SG(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Qm="right-scroll-bar-position",Xm="width-before-scroll-bar",kG="with-scroll-bars-hidden",OG="--removed-body-scroll-bar-size";function lx(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function CG(e,t){var n=C.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var AG=typeof window<"u"?C.useLayoutEffect:C.useEffect,f2=new WeakMap;function PG(e,t){var n=CG(null,function(r){return e.forEach(function(i){return lx(i,r)})});return AG(function(){var r=f2.get(n);if(r){var i=new Set(r),o=new Set(e),s=n.current;i.forEach(function(a){o.has(a)||lx(a,null)}),o.forEach(function(a){i.has(a)||lx(a,s)})}f2.set(n,e)},[e]),n}function EG(e){return e}function TG(e,t){t===void 0&&(t=EG);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var s=t(o,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(o),s=n}var l=function(){var c=s;s=[],c.forEach(o)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(c){s.push(c),u()},filter:function(c){return s=s.filter(c),n}}}};return i}function _G(e){e===void 0&&(e={});var t=TG(null);return t.options=ji({async:!0,ssr:!1},e),t}var HB=function(e){var t=e.sideCar,n=UB(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return C.createElement(r,ji({},n))};HB.isSideCarExport=!0;function jG(e,t){return e.useMedium(t),HB}var VB=_G(),ux=function(){},Zv=C.forwardRef(function(e,t){var n=C.useRef(null),r=C.useState({onScrollCapture:ux,onWheelCapture:ux,onTouchMoveCapture:ux}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,l=e.className,u=e.removeScrollBar,c=e.enabled,f=e.shards,h=e.sideCar,d=e.noRelative,p=e.noIsolation,m=e.inert,v=e.allowPinchZoom,b=e.as,y=b===void 0?"div":b,x=e.gapMode,k=UB(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=h,S=PG([n,t]),O=ji(ji({},k),i);return C.createElement(C.Fragment,null,c&&C.createElement(w,{sideCar:VB,removeScrollBar:u,shards:f,noRelative:d,noIsolation:p,inert:m,setCallbacks:o,allowPinchZoom:!!v,lockRef:n,gapMode:x}),s?C.cloneElement(C.Children.only(a),ji(ji({},O),{ref:S})):C.createElement(y,ji({},O,{className:l,ref:S}),a))});Zv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Zv.classNames={fullWidth:Xm,zeroRight:Qm};var MG=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function IG(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=MG();return t&&e.setAttribute("nonce",t),e}function NG(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function RG(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var DG=function(){var e=0,t=null;return{add:function(n){e==0&&(t=IG())&&(NG(t,n),RG(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},LG=function(){var e=DG();return function(t,n){C.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},qB=function(){var e=LG(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},$G={left:0,top:0,right:0,gap:0},cx=function(e){return parseInt(e||"",10)||0},BG=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[cx(n),cx(r),cx(i)]},FG=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return $G;var t=BG(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},zG=qB(),vu="data-scroll-locked",WG=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
57
|
-
.`.concat(kG,` {
|
|
58
|
-
overflow: hidden `).concat(r,`;
|
|
59
|
-
padding-right: `).concat(a,"px ").concat(r,`;
|
|
60
|
-
}
|
|
61
|
-
body[`).concat(vu,`] {
|
|
62
|
-
overflow: hidden `).concat(r,`;
|
|
63
|
-
overscroll-behavior: contain;
|
|
64
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
65
|
-
padding-left: `.concat(i,`px;
|
|
66
|
-
padding-top: `).concat(o,`px;
|
|
67
|
-
padding-right: `).concat(s,`px;
|
|
68
|
-
margin-left:0;
|
|
69
|
-
margin-top:0;
|
|
70
|
-
margin-right: `).concat(a,"px ").concat(r,`;
|
|
71
|
-
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.`).concat(Qm,` {
|
|
75
|
-
right: `).concat(a,"px ").concat(r,`;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.`).concat(Xm,` {
|
|
79
|
-
margin-right: `).concat(a,"px ").concat(r,`;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.`).concat(Qm," .").concat(Qm,` {
|
|
83
|
-
right: 0 `).concat(r,`;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.`).concat(Xm," .").concat(Xm,` {
|
|
87
|
-
margin-right: 0 `).concat(r,`;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
body[`).concat(vu,`] {
|
|
91
|
-
`).concat(OG,": ").concat(a,`px;
|
|
92
|
-
}
|
|
93
|
-
`)},h2=function(){var e=parseInt(document.body.getAttribute(vu)||"0",10);return isFinite(e)?e:0},UG=function(){C.useEffect(function(){return document.body.setAttribute(vu,(h2()+1).toString()),function(){var e=h2()-1;e<=0?document.body.removeAttribute(vu):document.body.setAttribute(vu,e.toString())}},[])},HG=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;UG();var o=C.useMemo(function(){return FG(i)},[i]);return C.createElement(zG,{styles:WG(o,!t,i,n?"":"!important")})},Vw=!1;if(typeof window<"u")try{var Bp=Object.defineProperty({},"passive",{get:function(){return Vw=!0,!0}});window.addEventListener("test",Bp,Bp),window.removeEventListener("test",Bp,Bp)}catch{Vw=!1}var kl=Vw?{passive:!1}:!1,VG=function(e){return e.tagName==="TEXTAREA"},KB=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!VG(e)&&n[t]==="visible")},qG=function(e){return KB(e,"overflowY")},KG=function(e){return KB(e,"overflowX")},d2=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=GB(e,r);if(i){var o=QB(e,r),s=o[1],a=o[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},GG=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},QG=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},GB=function(e,t){return e==="v"?qG(t):KG(t)},QB=function(e,t){return e==="v"?GG(t):QG(t)},XG=function(e,t){return e==="h"&&t==="rtl"?-1:1},YG=function(e,t,n,r,i){var o=XG(e,window.getComputedStyle(t).direction),s=o*r,a=n.target,l=t.contains(a),u=!1,c=s>0,f=0,h=0;do{if(!a)break;var d=QB(e,a),p=d[0],m=d[1],v=d[2],b=m-v-o*p;(p||b)&&GB(e,a)&&(f+=b,h+=p);var y=a.parentNode;a=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(c&&Math.abs(f)<1||!c&&Math.abs(h)<1)&&(u=!0),u},Fp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},p2=function(e){return[e.deltaX,e.deltaY]},m2=function(e){return e&&"current"in e?e.current:e},ZG=function(e,t){return e[0]===t[0]&&e[1]===t[1]},JG=function(e){return`
|
|
94
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
95
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
96
|
-
`)},eQ=0,Ol=[];function tQ(e){var t=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),i=C.useState(eQ++)[0],o=C.useState(qB)[0],s=C.useRef(e);C.useEffect(function(){s.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var m=SG([e.lockRef.current],(e.shards||[]).map(m2),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=C.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var b=Fp(m),y=n.current,x="deltaX"in m?m.deltaX:y[0]-b[0],k="deltaY"in m?m.deltaY:y[1]-b[1],w,S=m.target,O=Math.abs(x)>Math.abs(k)?"h":"v";if("touches"in m&&O==="h"&&S.type==="range")return!1;var A=window.getSelection(),P=A&&A.anchorNode,M=P?P===S||P.contains(S):!1;if(M)return!1;var j=d2(O,S);if(!j)return!0;if(j?w=O:(w=O==="v"?"h":"v",j=d2(O,S)),!j)return!1;if(!r.current&&"changedTouches"in m&&(x||k)&&(r.current=w),!w)return!0;var E=r.current||w;return YG(E,v,m,E==="h"?x:k)},[]),l=C.useCallback(function(m){var v=m;if(!(!Ol.length||Ol[Ol.length-1]!==o)){var b="deltaY"in v?p2(v):Fp(v),y=t.current.filter(function(w){return w.name===v.type&&(w.target===v.target||v.target===w.shadowParent)&&ZG(w.delta,b)})[0];if(y&&y.should){v.cancelable&&v.preventDefault();return}if(!y){var x=(s.current.shards||[]).map(m2).filter(Boolean).filter(function(w){return w.contains(v.target)}),k=x.length>0?a(v,x[0]):!s.current.noIsolation;k&&v.cancelable&&v.preventDefault()}}},[]),u=C.useCallback(function(m,v,b,y){var x={name:m,delta:v,target:b,should:y,shadowParent:nQ(b)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(k){return k!==x})},1)},[]),c=C.useCallback(function(m){n.current=Fp(m),r.current=void 0},[]),f=C.useCallback(function(m){u(m.type,p2(m),m.target,a(m,e.lockRef.current))},[]),h=C.useCallback(function(m){u(m.type,Fp(m),m.target,a(m,e.lockRef.current))},[]);C.useEffect(function(){return Ol.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,kl),document.addEventListener("touchmove",l,kl),document.addEventListener("touchstart",c,kl),function(){Ol=Ol.filter(function(m){return m!==o}),document.removeEventListener("wheel",l,kl),document.removeEventListener("touchmove",l,kl),document.removeEventListener("touchstart",c,kl)}},[]);var d=e.removeScrollBar,p=e.inert;return C.createElement(C.Fragment,null,p?C.createElement(o,{styles:JG(i)}):null,d?C.createElement(HG,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function nQ(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const rQ=jG(VB,tQ);var XB=C.forwardRef(function(e,t){return C.createElement(Zv,ji({},e,{ref:t,sideCar:rQ}))});XB.classNames=Zv.classNames;var iQ=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Cl=new WeakMap,zp=new WeakMap,Wp={},fx=0,YB=function(e){return e&&(e.host||YB(e.parentNode))},oQ=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=YB(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},sQ=function(e,t,n,r){var i=oQ(t,Array.isArray(e)?e:[e]);Wp[n]||(Wp[n]=new WeakMap);var o=Wp[n],s=[],a=new Set,l=new Set(i),u=function(f){!f||a.has(f)||(a.add(f),u(f.parentNode))};i.forEach(u);var c=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(h){if(a.has(h))c(h);else try{var d=h.getAttribute(r),p=d!==null&&d!=="false",m=(Cl.get(h)||0)+1,v=(o.get(h)||0)+1;Cl.set(h,m),o.set(h,v),s.push(h),m===1&&p&&zp.set(h,!0),v===1&&h.setAttribute(n,"true"),p||h.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",h,b)}})};return c(t),a.clear(),fx++,function(){s.forEach(function(f){var h=Cl.get(f)-1,d=o.get(f)-1;Cl.set(f,h),o.set(f,d),h||(zp.has(f)||f.removeAttribute(r),zp.delete(f)),d||f.removeAttribute(n)}),fx--,fx||(Cl=new WeakMap,Cl=new WeakMap,zp=new WeakMap,Wp={})}},aQ=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=iQ(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),sQ(r,i,n,"aria-hidden")):function(){return null}},Jv="Dialog",[ZB]=zK(Jv),[lQ,vi]=ZB(Jv),JB=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,a=C.useRef(null),l=C.useRef(null),[u,c]=qK({prop:r,defaultProp:i??!1,onChange:o,caller:Jv});return g.jsx(lQ,{scope:t,triggerRef:a,contentRef:l,contentId:bo(),titleId:bo(),descriptionId:bo(),open:u,onOpenChange:c,onOpenToggle:C.useCallback(()=>c(f=>!f),[c]),modal:s,children:n})};JB.displayName=Jv;var eF="DialogTrigger",uQ=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=vi(eF,n),o=fl(t,i.triggerRef);return g.jsx($o.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":KC(i.open),...r,ref:o,onClick:ws(e.onClick,i.onOpenToggle)})});uQ.displayName=eF;var VC="DialogPortal",[cQ,tF]=ZB(VC,{forceMount:void 0}),nF=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=vi(VC,t);return g.jsx(cQ,{scope:t,forceMount:n,children:C.Children.map(r,s=>g.jsx(Yv,{present:n||o.open,children:g.jsx(WB,{asChild:!0,container:i,children:s})}))})};nF.displayName=VC;var Fg="DialogOverlay",rF=C.forwardRef((e,t)=>{const n=tF(Fg,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=vi(Fg,e.__scopeDialog);return o.modal?g.jsx(Yv,{present:r||o.open,children:g.jsx(hQ,{...i,ref:t})}):null});rF.displayName=Fg;var fQ=DB("DialogOverlay.RemoveScroll"),hQ=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=vi(Fg,n);return g.jsx(XB,{as:fQ,allowPinchZoom:!0,shards:[i.contentRef],children:g.jsx($o.div,{"data-state":KC(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Qa="DialogContent",iF=C.forwardRef((e,t)=>{const n=tF(Qa,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=vi(Qa,e.__scopeDialog);return g.jsx(Yv,{present:r||o.open,children:o.modal?g.jsx(dQ,{...i,ref:t}):g.jsx(pQ,{...i,ref:t})})});iF.displayName=Qa;var dQ=C.forwardRef((e,t)=>{const n=vi(Qa,e.__scopeDialog),r=C.useRef(null),i=fl(t,n.contentRef,r);return C.useEffect(()=>{const o=r.current;if(o)return aQ(o)},[]),g.jsx(oF,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ws(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ws(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:ws(e.onFocusOutside,o=>o.preventDefault())})}),pQ=C.forwardRef((e,t)=>{const n=vi(Qa,e.__scopeDialog),r=C.useRef(!1),i=C.useRef(!1);return g.jsx(oF,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;n.triggerRef.current?.contains(s)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),oF=C.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,a=vi(Qa,n),l=C.useRef(null),u=fl(t,l);return wG(),g.jsxs(g.Fragment,{children:[g.jsx(FB,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:g.jsx($B,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":KC(a.open),...s,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(vQ,{titleId:a.titleId}),g.jsx(xQ,{contentRef:l,descriptionId:a.descriptionId})]})]})}),qC="DialogTitle",mQ=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=vi(qC,n);return g.jsx($o.h2,{id:i.titleId,...r,ref:t})});mQ.displayName=qC;var sF="DialogDescription",gQ=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=vi(sF,n);return g.jsx($o.p,{id:i.descriptionId,...r,ref:t})});gQ.displayName=sF;var aF="DialogClose",yQ=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=vi(aF,n);return g.jsx($o.button,{type:"button",...r,ref:t,onClick:ws(e.onClick,()=>i.onOpenChange(!1))})});yQ.displayName=aF;function KC(e){return e?"open":"closed"}var lF="DialogTitleWarning",[GBe,uF]=FK(lF,{contentName:Qa,titleName:qC,docsSlug:"dialog"}),vQ=({titleId:e})=>{const t=uF(lF),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
97
|
-
|
|
98
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
99
|
-
|
|
100
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return C.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},bQ="DialogDescriptionWarning",xQ=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${uF(bQ).contentName}}.`;return C.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},wQ=JB,SQ=nF,kQ=rF,OQ=iF,CQ=Symbol.for("react.lazy"),zg=HO[" use ".trim().toString()];function AQ(e){return typeof e=="object"&&e!==null&&"then"in e}function cF(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===CQ&&"_payload"in e&&AQ(e._payload)}function PQ(e){const t=EQ(e),n=C.forwardRef((r,i)=>{let{children:o,...s}=r;cF(o)&&typeof zg=="function"&&(o=zg(o._payload));const a=C.Children.toArray(o),l=a.find(_Q);if(l){const u=l.props.children,c=a.map(f=>f===l?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:f);return g.jsx(t,{...s,ref:i,children:C.isValidElement(u)?C.cloneElement(u,void 0,c):null})}return g.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function EQ(e){const t=C.forwardRef((n,r)=>{let{children:i,...o}=n;if(cF(i)&&typeof zg=="function"&&(i=zg(i._payload)),C.isValidElement(i)){const s=MQ(i),a=jQ(o,i.props);return i.type!==C.Fragment&&(a.ref=r?Es(r,s):s),C.cloneElement(i,a)}return C.Children.count(i)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var TQ=Symbol("radix.slottable");function _Q(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===TQ}function jQ(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{const l=o(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function MQ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var IQ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],zs=IQ.reduce((e,t)=>{const n=PQ(`Primitive.${t}`),r=C.forwardRef((i,o)=>{const{asChild:s,...a}=i,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(l,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),cf='[cmdk-group=""]',hx='[cmdk-group-items=""]',NQ='[cmdk-group-heading=""]',fF='[cmdk-item=""]',g2=`${fF}:not([aria-disabled="true"])`,qw="cmdk-item-select",Nl="data-value",RQ=(e,t,n)=>BK(e,t,n),hF=C.createContext(void 0),Xd=()=>C.useContext(hF),dF=C.createContext(void 0),GC=()=>C.useContext(dF),pF=C.createContext(void 0),mF=C.forwardRef((e,t)=>{let n=Rl(()=>{var I,_;return{search:"",value:(_=(I=e.value)!=null?I:e.defaultValue)!=null?_:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Rl(()=>new Set),i=Rl(()=>new Map),o=Rl(()=>new Map),s=Rl(()=>new Set),a=gF(e),{label:l,children:u,value:c,onValueChange:f,filter:h,shouldFilter:d,loop:p,disablePointerSelection:m=!1,vimBindings:v=!0,...b}=e,y=bo(),x=bo(),k=bo(),w=C.useRef(null),S=qQ();Xa(()=>{if(c!==void 0){let I=c.trim();n.current.value=I,O.emit()}},[c]),Xa(()=>{S(6,D)},[]);let O=C.useMemo(()=>({subscribe:I=>(s.current.add(I),()=>s.current.delete(I)),snapshot:()=>n.current,setState:(I,_,K)=>{var Q,te,he,ve;if(!Object.is(n.current[I],_)){if(n.current[I]=_,I==="search")E(),M(),S(1,j);else if(I==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let X=document.getElementById(k);X?X.focus():(Q=document.getElementById(y))==null||Q.focus()}if(S(7,()=>{var X;n.current.selectedItemId=(X=R())==null?void 0:X.id,O.emit()}),K||S(5,D),((te=a.current)==null?void 0:te.value)!==void 0){let X=_??"";(ve=(he=a.current).onValueChange)==null||ve.call(he,X);return}}O.emit()}},emit:()=>{s.current.forEach(I=>I())}}),[]),A=C.useMemo(()=>({value:(I,_,K)=>{var Q;_!==((Q=o.current.get(I))==null?void 0:Q.value)&&(o.current.set(I,{value:_,keywords:K}),n.current.filtered.items.set(I,P(_,K)),S(2,()=>{M(),O.emit()}))},item:(I,_)=>(r.current.add(I),_&&(i.current.has(_)?i.current.get(_).add(I):i.current.set(_,new Set([I]))),S(3,()=>{E(),M(),n.current.value||j(),O.emit()}),()=>{o.current.delete(I),r.current.delete(I),n.current.filtered.items.delete(I);let K=R();S(4,()=>{E(),K?.getAttribute("id")===I&&j(),O.emit()})}),group:I=>(i.current.has(I)||i.current.set(I,new Set),()=>{o.current.delete(I),i.current.delete(I)}),filter:()=>a.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:y,inputId:k,labelId:x,listInnerRef:w}),[]);function P(I,_){var K,Q;let te=(Q=(K=a.current)==null?void 0:K.filter)!=null?Q:RQ;return I?te(I,n.current.search,_):0}function M(){if(!n.current.search||a.current.shouldFilter===!1)return;let I=n.current.filtered.items,_=[];n.current.filtered.groups.forEach(Q=>{let te=i.current.get(Q),he=0;te.forEach(ve=>{let X=I.get(ve);he=Math.max(X,he)}),_.push([Q,he])});let K=w.current;N().sort((Q,te)=>{var he,ve;let X=Q.getAttribute("id"),ue=te.getAttribute("id");return((he=I.get(ue))!=null?he:0)-((ve=I.get(X))!=null?ve:0)}).forEach(Q=>{let te=Q.closest(hx);te?te.appendChild(Q.parentElement===te?Q:Q.closest(`${hx} > *`)):K.appendChild(Q.parentElement===K?Q:Q.closest(`${hx} > *`))}),_.sort((Q,te)=>te[1]-Q[1]).forEach(Q=>{var te;let he=(te=w.current)==null?void 0:te.querySelector(`${cf}[${Nl}="${encodeURIComponent(Q[0])}"]`);he?.parentElement.appendChild(he)})}function j(){let I=N().find(K=>K.getAttribute("aria-disabled")!=="true"),_=I?.getAttribute(Nl);O.setState("value",_||void 0)}function E(){var I,_,K,Q;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let te=0;for(let he of r.current){let ve=(_=(I=o.current.get(he))==null?void 0:I.value)!=null?_:"",X=(Q=(K=o.current.get(he))==null?void 0:K.keywords)!=null?Q:[],ue=P(ve,X);n.current.filtered.items.set(he,ue),ue>0&&te++}for(let[he,ve]of i.current)for(let X of ve)if(n.current.filtered.items.get(X)>0){n.current.filtered.groups.add(he);break}n.current.filtered.count=te}function D(){var I,_,K;let Q=R();Q&&(((I=Q.parentElement)==null?void 0:I.firstChild)===Q&&((K=(_=Q.closest(cf))==null?void 0:_.querySelector(NQ))==null||K.scrollIntoView({block:"nearest"})),Q.scrollIntoView({block:"nearest"}))}function R(){var I;return(I=w.current)==null?void 0:I.querySelector(`${fF}[aria-selected="true"]`)}function N(){var I;return Array.from(((I=w.current)==null?void 0:I.querySelectorAll(g2))||[])}function B(I){let _=N()[I];_&&O.setState("value",_.getAttribute(Nl))}function F(I){var _;let K=R(),Q=N(),te=Q.findIndex(ve=>ve===K),he=Q[te+I];(_=a.current)!=null&&_.loop&&(he=te+I<0?Q[Q.length-1]:te+I===Q.length?Q[0]:Q[te+I]),he&&O.setState("value",he.getAttribute(Nl))}function $(I){let _=R(),K=_?.closest(cf),Q;for(;K&&!Q;)K=I>0?HQ(K,cf):VQ(K,cf),Q=K?.querySelector(g2);Q?O.setState("value",Q.getAttribute(Nl)):F(I)}let z=()=>B(N().length-1),T=I=>{I.preventDefault(),I.metaKey?z():I.altKey?$(1):F(1)},q=I=>{I.preventDefault(),I.metaKey?B(0):I.altKey?$(-1):F(-1)};return C.createElement(zs.div,{ref:t,tabIndex:-1,...b,"cmdk-root":"",onKeyDown:I=>{var _;(_=b.onKeyDown)==null||_.call(b,I);let K=I.nativeEvent.isComposing||I.keyCode===229;if(!(I.defaultPrevented||K))switch(I.key){case"n":case"j":{v&&I.ctrlKey&&T(I);break}case"ArrowDown":{T(I);break}case"p":case"k":{v&&I.ctrlKey&&q(I);break}case"ArrowUp":{q(I);break}case"Home":{I.preventDefault(),B(0);break}case"End":{I.preventDefault(),z();break}case"Enter":{I.preventDefault();let Q=R();if(Q){let te=new Event(qw);Q.dispatchEvent(te)}}}}},C.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:GQ},l),e0(e,I=>C.createElement(dF.Provider,{value:O},C.createElement(hF.Provider,{value:A},I))))}),DQ=C.forwardRef((e,t)=>{var n,r;let i=bo(),o=C.useRef(null),s=C.useContext(pF),a=Xd(),l=gF(e),u=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:s?.forceMount;Xa(()=>{if(!u)return a.item(i,s?.id)},[u]);let c=yF(i,o,[e.value,e.children,o],e.keywords),f=GC(),h=Ts(S=>S.value&&S.value===c.current),d=Ts(S=>u||a.filter()===!1?!0:S.search?S.filtered.items.get(i)>0:!0);C.useEffect(()=>{let S=o.current;if(!(!S||e.disabled))return S.addEventListener(qw,p),()=>S.removeEventListener(qw,p)},[d,e.onSelect,e.disabled]);function p(){var S,O;m(),(O=(S=l.current).onSelect)==null||O.call(S,c.current)}function m(){f.setState("value",c.current,!0)}if(!d)return null;let{disabled:v,value:b,onSelect:y,forceMount:x,keywords:k,...w}=e;return C.createElement(zs.div,{ref:Es(o,t),...w,id:i,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!h,"data-disabled":!!v,"data-selected":!!h,onPointerMove:v||a.getDisablePointerSelection()?void 0:m,onClick:v?void 0:p},e.children)}),LQ=C.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,s=bo(),a=C.useRef(null),l=C.useRef(null),u=bo(),c=Xd(),f=Ts(d=>i||c.filter()===!1?!0:d.search?d.filtered.groups.has(s):!0);Xa(()=>c.group(s),[]),yF(s,a,[e.value,e.heading,l]);let h=C.useMemo(()=>({id:s,forceMount:i}),[i]);return C.createElement(zs.div,{ref:Es(a,t),...o,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&C.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),e0(e,d=>C.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},C.createElement(pF.Provider,{value:h},d))))}),$Q=C.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=C.useRef(null),o=Ts(s=>!s.search);return!n&&!o?null:C.createElement(zs.div,{ref:Es(i,t),...r,"cmdk-separator":"",role:"separator"})}),BQ=C.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=GC(),s=Ts(u=>u.search),a=Ts(u=>u.selectedItemId),l=Xd();return C.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),C.createElement(zs.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":a,id:l.inputId,type:"text",value:i?e.value:s,onChange:u=>{i||o.setState("search",u.target.value),n?.(u.target.value)}})}),FQ=C.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,o=C.useRef(null),s=C.useRef(null),a=Ts(u=>u.selectedItemId),l=Xd();return C.useEffect(()=>{if(s.current&&o.current){let u=s.current,c=o.current,f,h=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let d=u.offsetHeight;c.style.setProperty("--cmdk-list-height",d.toFixed(1)+"px")})});return h.observe(u),()=>{cancelAnimationFrame(f),h.unobserve(u)}}},[]),C.createElement(zs.div,{ref:Es(o,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:l.listId},e0(e,u=>C.createElement("div",{ref:Es(s,l.listInnerRef),"cmdk-list-sizer":""},u)))}),zQ=C.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:s,...a}=e;return C.createElement(wQ,{open:n,onOpenChange:r},C.createElement(SQ,{container:s},C.createElement(kQ,{"cmdk-overlay":"",className:i}),C.createElement(OQ,{"aria-label":e.label,"cmdk-dialog":"",className:o},C.createElement(mF,{ref:t,...a}))))}),WQ=C.forwardRef((e,t)=>Ts(n=>n.filtered.count===0)?C.createElement(zs.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),UQ=C.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...o}=e;return C.createElement(zs.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},e0(e,s=>C.createElement("div",{"aria-hidden":!0},s)))}),rn=Object.assign(mF,{List:FQ,Item:DQ,Input:BQ,Group:LQ,Separator:$Q,Dialog:zQ,Empty:WQ,Loading:UQ});function HQ(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function VQ(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function gF(e){let t=C.useRef(e);return Xa(()=>{t.current=e}),t}var Xa=typeof window>"u"?C.useEffect:C.useLayoutEffect;function Rl(e){let t=C.useRef();return t.current===void 0&&(t.current=e()),t}function Ts(e){let t=GC(),n=()=>e(t.snapshot());return C.useSyncExternalStore(t.subscribe,n,n)}function yF(e,t,n,r=[]){let i=C.useRef(),o=Xd();return Xa(()=>{var s;let a=(()=>{var u;for(let c of n){if(typeof c=="string")return c.trim();if(typeof c=="object"&&"current"in c)return c.current?(u=c.current.textContent)==null?void 0:u.trim():i.current}})(),l=r.map(u=>u.trim());o.value(e,a,l),(s=t.current)==null||s.setAttribute(Nl,a),i.current=a}),i}var qQ=()=>{let[e,t]=C.useState(),n=Rl(()=>new Map);return Xa(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function KQ(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function e0({asChild:e,children:t},n){return e&&C.isValidElement(t)?C.cloneElement(KQ(t),{ref:t.ref},n(t.props.children)):n(t)}var GQ={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};/**
|
|
101
|
-
* @license lucide-react v0.460.0 - ISC
|
|
102
|
-
*
|
|
103
|
-
* This source code is licensed under the ISC license.
|
|
104
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
-
*/const QQ=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),vF=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
106
|
-
* @license lucide-react v0.460.0 - ISC
|
|
107
|
-
*
|
|
108
|
-
* This source code is licensed under the ISC license.
|
|
109
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
-
*/var XQ={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
111
|
-
* @license lucide-react v0.460.0 - ISC
|
|
112
|
-
*
|
|
113
|
-
* This source code is licensed under the ISC license.
|
|
114
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
-
*/const YQ=C.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...a},l)=>C.createElement("svg",{ref:l,...XQ,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:vF("lucide",i),...a},[...s.map(([u,c])=>C.createElement(u,c)),...Array.isArray(o)?o:[o]]));/**
|
|
116
|
-
* @license lucide-react v0.460.0 - ISC
|
|
117
|
-
*
|
|
118
|
-
* This source code is licensed under the ISC license.
|
|
119
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
-
*/const Le=(e,t)=>{const n=C.forwardRef(({className:r,...i},o)=>C.createElement(YQ,{ref:o,iconNode:t,className:vF(`lucide-${QQ(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
|
|
121
|
-
* @license lucide-react v0.460.0 - ISC
|
|
122
|
-
*
|
|
123
|
-
* This source code is licensed under the ISC license.
|
|
124
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
-
*/const ZQ=Le("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
|
126
|
-
* @license lucide-react v0.460.0 - ISC
|
|
127
|
-
*
|
|
128
|
-
* This source code is licensed under the ISC license.
|
|
129
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
-
*/const JQ=Le("BadgeCheck",[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
131
|
-
* @license lucide-react v0.460.0 - ISC
|
|
132
|
-
*
|
|
133
|
-
* This source code is licensed under the ISC license.
|
|
134
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
-
*/const eX=Le("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
|
|
136
|
-
* @license lucide-react v0.460.0 - ISC
|
|
137
|
-
*
|
|
138
|
-
* This source code is licensed under the ISC license.
|
|
139
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
-
*/const bF=Le("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
141
|
-
* @license lucide-react v0.460.0 - ISC
|
|
142
|
-
*
|
|
143
|
-
* This source code is licensed under the ISC license.
|
|
144
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
-
*/const tX=Le("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
146
|
-
* @license lucide-react v0.460.0 - ISC
|
|
147
|
-
*
|
|
148
|
-
* This source code is licensed under the ISC license.
|
|
149
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
-
*/const t0=Le("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
151
|
-
* @license lucide-react v0.460.0 - ISC
|
|
152
|
-
*
|
|
153
|
-
* This source code is licensed under the ISC license.
|
|
154
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
-
*/const xF=Le("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
156
|
-
* @license lucide-react v0.460.0 - ISC
|
|
157
|
-
*
|
|
158
|
-
* This source code is licensed under the ISC license.
|
|
159
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
-
*/const nX=Le("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
|
|
161
|
-
* @license lucide-react v0.460.0 - ISC
|
|
162
|
-
*
|
|
163
|
-
* This source code is licensed under the ISC license.
|
|
164
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
-
*/const QC=Le("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
166
|
-
* @license lucide-react v0.460.0 - ISC
|
|
167
|
-
*
|
|
168
|
-
* This source code is licensed under the ISC license.
|
|
169
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
-
*/const rX=Le("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
|
|
171
|
-
* @license lucide-react v0.460.0 - ISC
|
|
172
|
-
*
|
|
173
|
-
* This source code is licensed under the ISC license.
|
|
174
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
-
*/const iX=Le("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
176
|
-
* @license lucide-react v0.460.0 - ISC
|
|
177
|
-
*
|
|
178
|
-
* This source code is licensed under the ISC license.
|
|
179
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
-
*/const XC=Le("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
181
|
-
* @license lucide-react v0.460.0 - ISC
|
|
182
|
-
*
|
|
183
|
-
* This source code is licensed under the ISC license.
|
|
184
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
-
*/const oX=Le("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
186
|
-
* @license lucide-react v0.460.0 - ISC
|
|
187
|
-
*
|
|
188
|
-
* This source code is licensed under the ISC license.
|
|
189
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
-
*/const wF=Le("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);/**
|
|
191
|
-
* @license lucide-react v0.460.0 - ISC
|
|
192
|
-
*
|
|
193
|
-
* This source code is licensed under the ISC license.
|
|
194
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
-
*/const sX=Le("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
|
|
196
|
-
* @license lucide-react v0.460.0 - ISC
|
|
197
|
-
*
|
|
198
|
-
* This source code is licensed under the ISC license.
|
|
199
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
-
*/const Kw=Le("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
201
|
-
* @license lucide-react v0.460.0 - ISC
|
|
202
|
-
*
|
|
203
|
-
* This source code is licensed under the ISC license.
|
|
204
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
-
*/const SF=Le("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
|
|
206
|
-
* @license lucide-react v0.460.0 - ISC
|
|
207
|
-
*
|
|
208
|
-
* This source code is licensed under the ISC license.
|
|
209
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
-
*/const YC=Le("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
|
|
211
|
-
* @license lucide-react v0.460.0 - ISC
|
|
212
|
-
*
|
|
213
|
-
* This source code is licensed under the ISC license.
|
|
214
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
-
*/const kF=Le("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
216
|
-
* @license lucide-react v0.460.0 - ISC
|
|
217
|
-
*
|
|
218
|
-
* This source code is licensed under the ISC license.
|
|
219
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
-
*/const OF=Le("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
|
|
221
|
-
* @license lucide-react v0.460.0 - ISC
|
|
222
|
-
*
|
|
223
|
-
* This source code is licensed under the ISC license.
|
|
224
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
-
*/const aX=Le("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
226
|
-
* @license lucide-react v0.460.0 - ISC
|
|
227
|
-
*
|
|
228
|
-
* This source code is licensed under the ISC license.
|
|
229
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
-
*/const lX=Le("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
231
|
-
* @license lucide-react v0.460.0 - ISC
|
|
232
|
-
*
|
|
233
|
-
* This source code is licensed under the ISC license.
|
|
234
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
-
*/const ZC=Le("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
236
|
-
* @license lucide-react v0.460.0 - ISC
|
|
237
|
-
*
|
|
238
|
-
* This source code is licensed under the ISC license.
|
|
239
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
-
*/const uX=Le("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
|
|
241
|
-
* @license lucide-react v0.460.0 - ISC
|
|
242
|
-
*
|
|
243
|
-
* This source code is licensed under the ISC license.
|
|
244
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
-
*/const n0=Le("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
246
|
-
* @license lucide-react v0.460.0 - ISC
|
|
247
|
-
*
|
|
248
|
-
* This source code is licensed under the ISC license.
|
|
249
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
-
*/const Xf=Le("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
251
|
-
* @license lucide-react v0.460.0 - ISC
|
|
252
|
-
*
|
|
253
|
-
* This source code is licensed under the ISC license.
|
|
254
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
-
*/const CF=Le("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
|
|
256
|
-
* @license lucide-react v0.460.0 - ISC
|
|
257
|
-
*
|
|
258
|
-
* This source code is licensed under the ISC license.
|
|
259
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
-
*/const AF=Le("SquareKanban",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 7v7",key:"1x2jlm"}],["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M16 7v9",key:"1hp2iy"}]]);/**
|
|
261
|
-
* @license lucide-react v0.460.0 - ISC
|
|
262
|
-
*
|
|
263
|
-
* This source code is licensed under the ISC license.
|
|
264
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
-
*/const PF=Le("Stethoscope",[["path",{d:"M11 2v2",key:"1539x4"}],["path",{d:"M5 2v2",key:"1yf1q8"}],["path",{d:"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1",key:"rb5t3r"}],["path",{d:"M8 15a6 6 0 0 0 12 0v-3",key:"x18d4x"}],["circle",{cx:"20",cy:"10",r:"2",key:"ts1r5v"}]]);/**
|
|
266
|
-
* @license lucide-react v0.460.0 - ISC
|
|
267
|
-
*
|
|
268
|
-
* This source code is licensed under the ISC license.
|
|
269
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
-
*/const zh=Le("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
271
|
-
* @license lucide-react v0.460.0 - ISC
|
|
272
|
-
*
|
|
273
|
-
* This source code is licensed under the ISC license.
|
|
274
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
-
*/const EF=Le("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
276
|
-
* @license lucide-react v0.460.0 - ISC
|
|
277
|
-
*
|
|
278
|
-
* This source code is licensed under the ISC license.
|
|
279
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
-
*/const TF=Le("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
|
|
281
|
-
* @license lucide-react v0.460.0 - ISC
|
|
282
|
-
*
|
|
283
|
-
* This source code is licensed under the ISC license.
|
|
284
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
-
*/const cX=Le("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),_F="squad.console.density";function fX(){return typeof window>"u"?"comfortable":window.localStorage.getItem(_F)==="compact"?"compact":"comfortable"}function hX(e){typeof document>"u"||(document.documentElement.dataset.density=e)}function jF(){const[e,t]=C.useState(fX);C.useEffect(()=>{hX(e),typeof window<"u"&&window.localStorage.setItem(_F,e)},[e]);const n=C.useCallback(i=>t(i),[]),r=C.useCallback(()=>t(i=>i==="compact"?"comfortable":"compact"),[]);return{density:e,setDensity:n,toggle:r}}const dX=[{id:"pg-dashboard",label:"Dashboard",to:"/",Icon:SF,hint:"g d"},{id:"pg-stories",label:"Stories",to:"/stories",Icon:YC,hint:"g s"},{id:"pg-plans",label:"Plans",to:"/plans",Icon:XC,hint:"g p"},{id:"pg-generate",label:"Generate plan",to:"/generate",Icon:CF,hint:"g r"},{id:"pg-config",label:"Config",to:"/config",Icon:Xf,hint:"g c"},{id:"pg-secrets",label:"Secrets",to:"/secrets",Icon:OF,hint:"g k"},{id:"pg-tracker",label:"Tracker",to:"/tracker",Icon:AF,hint:"g t"},{id:"pg-doctor",label:"Doctor",to:"/doctor",Icon:PF,hint:"g h"}];function pX(){const[e,t]=C.useState(!1),[n,r]=C.useState(""),i=_r(),{toggle:o}=jF();C.useEffect(()=>{const f=d=>{(d.metaKey||d.ctrlKey)&&d.key.toLowerCase()==="k"&&(d.preventDefault(),t(p=>!p))},h=()=>t(!0);return window.addEventListener("keydown",f),window.addEventListener("squad:cmdk:open",h),()=>{window.removeEventListener("keydown",f),window.removeEventListener("squad:cmdk:open",h)}},[]);const s=wt({queryKey:["stories"],queryFn:()=>Me("/api/stories"),enabled:e}),a=wt({queryKey:["plans"],queryFn:()=>Me("/api/plans"),enabled:e}),l=(s.data??[]).slice(0,5),u=(a.data??[]).slice(0,5),c=()=>{t(!1),r("")};return e?ll.createPortal(g.jsx("div",{role:"presentation",onMouseDown:f=>{f.target===f.currentTarget&&c()},className:"fixed inset-0 z-[var(--z-modal)] flex items-start justify-center p-4 pt-[12vh] animate-fade-in",style:{background:"rgba(0,0,0,0.6)"},children:g.jsx("div",{className:"w-full max-w-xl overflow-hidden rounded-[var(--radius-xl)] border border-[var(--color-border)] bg-[var(--color-bg-elevated)] shadow-2xl animate-fade-up",children:g.jsxs(rn,{label:"Command palette",value:n,onValueChange:r,loop:!0,children:[g.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--color-border)] px-3 py-2",children:[g.jsx(n0,{size:14,className:"text-[var(--color-text-dim)]","aria-hidden":!0}),g.jsx(rn.Input,{placeholder:"Type a command or search…",className:"flex-1 bg-transparent py-1.5 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-dim)] outline-none",autoFocus:!0})]}),g.jsxs(rn.List,{className:"max-h-[60vh] overflow-auto p-1.5",children:[g.jsx(rn.Empty,{className:"px-3 py-6 text-center text-sm text-[var(--color-text-muted)]",children:"No matches."}),g.jsx(rn.Group,{heading:"Pages",className:"mb-2",children:dX.map(f=>g.jsxs(rn.Item,{value:`page ${f.label}`,onSelect:()=>{i({to:f.to}),c()},className:"cmdk-row",children:[g.jsx(f.Icon,{size:14,className:"text-[var(--color-text-dim)]","aria-hidden":!0}),g.jsx("span",{className:"flex-1",children:f.label}),g.jsx("span",{className:"kbd",children:f.hint})]},f.id))}),g.jsxs(rn.Group,{heading:"Actions",className:"mb-2",children:[g.jsxs(rn.Item,{value:"action new story",onSelect:()=>{i({to:"/stories"}),window.dispatchEvent(new CustomEvent("squad:dialog:new-story")),c()},className:"cmdk-row",children:[g.jsx(ZC,{size:14,className:"text-[var(--color-text-dim)]","aria-hidden":!0}),g.jsx("span",{className:"flex-1",children:"New story"}),g.jsx("span",{className:"kbd",children:"n s"})]}),g.jsxs(rn.Item,{value:"action generate plan from latest unplanned story",onSelect:()=>{i({to:"/generate"}),c()},className:"cmdk-row",children:[g.jsx(nX,{size:14,className:"text-[var(--color-text-dim)]","aria-hidden":!0}),g.jsx("span",{className:"flex-1",children:"Generate plan from latest unplanned story"})]}),g.jsxs(rn.Item,{value:"action run doctor",onSelect:()=>{i({to:"/doctor"}),c()},className:"cmdk-row",children:[g.jsx(ZQ,{size:14,className:"text-[var(--color-text-dim)]","aria-hidden":!0}),g.jsx("span",{className:"flex-1",children:"Run doctor"})]}),g.jsxs(rn.Item,{value:"action open config",onSelect:()=>{i({to:"/config"}),c()},className:"cmdk-row",children:[g.jsx(Xf,{size:14,className:"text-[var(--color-text-dim)]","aria-hidden":!0}),g.jsx("span",{className:"flex-1",children:"Open config"})]}),g.jsxs(rn.Item,{value:"action switch density",onSelect:()=>{o(),c()},className:"cmdk-row",children:[g.jsx(Xf,{size:14,className:"text-[var(--color-text-dim)]","aria-hidden":!0}),g.jsx("span",{className:"flex-1",children:"Switch density"})]}),g.jsxs(rn.Item,{value:"action keyboard shortcuts",onSelect:()=>{c(),window.dispatchEvent(new CustomEvent("squad:dialog:shortcuts"))},className:"cmdk-row",children:[g.jsx(Xf,{size:14,className:"text-[var(--color-text-dim)]","aria-hidden":!0}),g.jsx("span",{className:"flex-1",children:"Open keyboard shortcuts"}),g.jsx("span",{className:"kbd",children:"?"})]})]}),l.length>0?g.jsx(rn.Group,{heading:"Recent stories",className:"mb-2",children:l.map(f=>g.jsxs(rn.Item,{value:`story ${f.feature} ${f.id} ${f.titleHint??""}`,onSelect:()=>{i({to:"/stories/$feature/$id",params:{feature:f.feature,id:f.id}}),c()},className:"cmdk-row",children:[g.jsx(YC,{size:14,className:"text-[var(--color-text-dim)]","aria-hidden":!0}),g.jsxs("span",{className:"font-mono text-[12px] text-[var(--color-text-muted)]",children:[f.feature,"/"]}),g.jsx("span",{className:"flex-1 truncate",children:f.titleHint||f.id})]},`s-${f.feature}-${f.id}`))}):null,u.length>0?g.jsx(rn.Group,{heading:"Recent plans",children:u.map(f=>g.jsxs(rn.Item,{value:`plan ${f.feature} ${f.planFile}`,onSelect:()=>{i({to:"/plans/$feature/$planFile",params:{feature:f.feature,planFile:f.planFile}}),c()},className:"cmdk-row",children:[g.jsx(XC,{size:14,className:"text-[var(--color-text-dim)]","aria-hidden":!0}),g.jsxs("span",{className:"font-mono text-[12px] text-[var(--color-text-muted)]",children:[f.feature,"/"]}),g.jsx("span",{className:"flex-1 truncate",children:f.planFile})]},`p-${f.feature}-${f.planFile}`))}):null]})]})})}),document.body):null}const mX={sm:"max-w-sm",md:"max-w-lg",lg:"max-w-2xl"};function Tc({open:e,title:t,description:n,children:r,onClose:i,footer:o,size:s="md",dismissible:a=!0}){const l=C.useRef(null),u=C.useRef(null);C.useEffect(()=>{e?u.current=document.activeElement??null:u.current&&document.contains(u.current)&&(u.current.focus(),u.current=null)},[e]),C.useEffect(()=>{if(!e)return;const f=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=f}},[e]),C.useEffect(()=>{if(!e)return;const f=window.setTimeout(()=>{const h=l.current;if(!h)return;(h.querySelector('a[href], button:not([disabled]), textarea, input, select, [tabindex]:not([tabindex="-1"])')??h).focus()},0);return()=>window.clearTimeout(f)},[e]);const c=C.useCallback(f=>{if(f.key==="Escape"&&a){f.stopPropagation(),i();return}if(f.key!=="Tab")return;const h=l.current;if(!h)return;const d=Array.from(h.querySelectorAll('a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter(b=>!b.hasAttribute("aria-hidden"));if(d.length===0)return;const p=d[0],m=d[d.length-1],v=document.activeElement;f.shiftKey&&v===p?(f.preventDefault(),m.focus()):!f.shiftKey&&v===m&&(f.preventDefault(),p.focus())},[a,i]);return e?ll.createPortal(g.jsx("div",{role:"presentation",onMouseDown:f=>{a&&f.target===f.currentTarget&&i()},onKeyDown:c,className:"fixed inset-0 z-[var(--z-modal)] flex items-center justify-center p-4 animate-fade-in",style:{background:"rgba(0, 0, 0, 0.6)"},children:g.jsxs("div",{ref:l,role:"dialog","aria-modal":"true","aria-labelledby":"squad-dialog-title",tabIndex:-1,className:`relative w-full ${mX[s]} rounded-[var(--radius-xl)] border border-[var(--color-border)] bg-[var(--color-bg-elevated)] shadow-2xl outline-none animate-fade-up`,children:[g.jsxs("div",{className:"border-b border-[var(--color-border)] px-5 py-3",children:[g.jsx("div",{id:"squad-dialog-title",className:"text-sm font-semibold text-[var(--color-text)]",children:t}),n?g.jsx("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:n}):null]}),g.jsx("div",{className:"px-5 py-4 text-sm text-[var(--color-text)]",children:r}),g.jsx("div",{className:"flex justify-end gap-2 border-t border-[var(--color-border)] px-5 py-3",children:o??g.jsx("button",{type:"button",className:"btn-secondary",onClick:i,children:"Close"})})]})}),document.body):null}const gX={xs:10,sm:12,md:16,lg:20};function Yd({size:e="md",style:t,className:n="",...r}){const i=gX[e],o={width:i,height:i,borderWidth:Math.max(1,Math.floor(i/8)),borderStyle:"solid",borderColor:"currentColor",borderTopColor:"transparent",borderRadius:"999px",display:"inline-block",animation:"spin 0.7s linear infinite",...t};return g.jsx("span",{role:"status","aria-label":"Loading",style:o,className:n,...r})}const yX={primary:"btn-primary",secondary:"btn-secondary",ghost:"btn-ghost",danger:"btn-danger"},vX={sm:"px-2.5 py-1 text-[13px]",md:""},fe=C.forwardRef(function({variant:t="primary",size:n="md",loading:r=!1,leftIcon:i,rightIcon:o,className:s="",disabled:a,children:l,...u},c){return g.jsxs("button",{ref:c,className:`${yX[t]} ${vX[n]} ${s}`.trim(),disabled:a||r,"data-loading":r||void 0,...u,children:[r?g.jsx(Yd,{size:"sm","aria-hidden":!0}):i,g.jsx("span",{children:l}),!r&&o]})}),MF=C.createContext(null);function r0(){const e=C.useContext(MF);if(!e)throw new Error("useConfirm must be used inside <ConfirmProvider>");return e.confirm}function bX({children:e}){const[t,n]=C.useState(null),r=C.useCallback(o=>new Promise(s=>{n({options:typeof o=="string"?{title:o}:o,resolve:s})}),[]),i=o=>{t&&(t.resolve(o),n(null))};return g.jsxs(MF.Provider,{value:{confirm:r},children:[e,g.jsx(Tc,{open:t!==null,title:t?.options.title??"",description:t?.options.description,size:"sm",onClose:()=>i(!1),footer:g.jsxs(g.Fragment,{children:[g.jsx(fe,{type:"button",variant:"ghost",onClick:()=>i(!1),children:t?.options.cancelLabel??"Cancel"}),g.jsx(fe,{type:"button",variant:t?.options.tone==="danger"?"danger":"primary",onClick:()=>i(!0),children:t?.options.confirmLabel??"Confirm"})]}),children:null})]})}function Wi({className:e="",children:t,...n}){return g.jsx("span",{className:`kbd ${e}`,...n,children:t})}const xX=[{title:"Navigation",rows:[{keys:["g","d"],label:"Dashboard"},{keys:["g","s"],label:"Stories"},{keys:["g","p"],label:"Plans"},{keys:["g","r"],label:"Generate plan"},{keys:["g","c"],label:"Config"},{keys:["g","k"],label:"Secrets"},{keys:["g","t"],label:"Tracker"},{keys:["g","h"],label:"Doctor"}]},{title:"Actions",rows:[{keys:["⌘","K"],label:"Open command palette"},{keys:["n","s"],label:"New story"},{keys:["?"],label:"Show this cheatsheet"},{keys:["Esc"],label:"Close any dialog"}]}];function wX(){const[e,t]=C.useState(!1);return C.useEffect(()=>{const n=()=>t(!0);return window.addEventListener("squad:dialog:shortcuts",n),()=>window.removeEventListener("squad:dialog:shortcuts",n)},[]),g.jsx(Tc,{open:e,onClose:()=>t(!1),title:"Keyboard shortcuts",size:"md",children:g.jsx("div",{className:"space-y-5",children:xX.map(n=>g.jsxs("div",{children:[g.jsx("div",{className:"mb-2 text-[11px] font-semibold uppercase tracking-wider text-[var(--color-text-dim)]",children:n.title}),g.jsx("ul",{className:"space-y-1.5",children:n.rows.map(r=>g.jsxs("li",{className:"flex items-center justify-between text-[13px]",children:[g.jsx("span",{className:"text-[var(--color-text)]",children:r.label}),g.jsx("span",{className:"flex items-center gap-1",children:r.keys.map(i=>g.jsx(Wi,{children:i},`${r.label}-${i}`))})]},r.label))})]},n.title))})})}const IF=C.createContext(null);function Qr(){const e=C.useContext(IF);if(!e)throw new Error("useToast must be used inside <ToastProvider>");return e}const SX={default:null,success:g.jsx(xF,{size:14,className:"text-[var(--color-ok)]","aria-hidden":!0}),warning:g.jsx(EF,{size:14,className:"text-[var(--color-warn)]","aria-hidden":!0}),danger:g.jsx(t0,{size:14,className:"text-[var(--color-fail)]","aria-hidden":!0}),info:g.jsx(Kw,{size:14,className:"text-[var(--color-info)]","aria-hidden":!0})};let y2=0;function kX(){return y2+=1,`t${y2}`}function OX({children:e}){const[t,n]=C.useState([]),r=C.useRef(new Map),i=C.useCallback(s=>{n(l=>l.filter(u=>u.id!==s));const a=r.current.get(s);a&&(window.clearTimeout(a),r.current.delete(s))},[]),o=C.useCallback(s=>{const a=typeof s=="string"?{title:s}:s,l=a.id??kX(),u={id:l,tone:a.tone??"default",duration:a.duration??4500,title:a.title,description:a.description,action:a.action};if(n(c=>[...c,u]),u.duration>0){const c=window.setTimeout(()=>i(l),u.duration);r.current.set(l,c)}return l},[i]);return C.useEffect(()=>()=>{for(const s of r.current.values())window.clearTimeout(s);r.current.clear()},[]),g.jsxs(IF.Provider,{value:{toast:o,dismiss:i},children:[e,ll.createPortal(g.jsx("ol",{"aria-live":"polite","aria-atomic":"false",className:"pointer-events-none fixed bottom-6 right-6 z-[var(--z-toast)] flex w-[min(calc(100vw-3rem),360px)] flex-col gap-2",children:t.map(s=>g.jsx("li",{className:"pointer-events-auto rounded-[var(--radius-md)] border border-[var(--color-border-strong)] bg-[var(--gray-3)] px-3 py-2 text-sm text-[var(--color-text)] shadow-2xl animate-fade-up",children:g.jsxs("div",{className:"flex items-start gap-2",children:[SX[s.tone],g.jsxs("div",{className:"min-w-0 flex-1",children:[s.title?g.jsx("div",{className:"font-medium leading-snug",children:s.title}):null,s.description?g.jsx("div",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:s.description}):null,s.action?g.jsx("button",{type:"button",className:"mt-1.5 text-xs font-medium text-[var(--color-accent)] hover:underline",onClick:()=>{s.action?.onClick(),i(s.id)},children:s.action.label}):null]}),g.jsx("button",{type:"button","aria-label":"Dismiss",onClick:()=>i(s.id),className:"rounded-[var(--radius-sm)] p-0.5 text-[var(--color-text-dim)] hover:text-[var(--color-text)]",children:g.jsx(cX,{size:14})})]})},s.id))}),document.body)]})}const CX=1200,v2={d:"/",s:"/stories",p:"/plans",r:"/generate",c:"/config",k:"/secrets",t:"/tracker",h:"/doctor"};function AX(e){if(!e||!(e instanceof Element))return!1;if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)return!0;const t=e.getAttribute("contenteditable");return t===""||t==="true"||e.tagName==="SELECT"}function PX(){const e=_r();C.useEffect(()=>{let t=null,n=0;const r=i=>{if(i.metaKey||i.ctrlKey||i.altKey||AX(i.target))return;const o=i.key.toLowerCase();if(i.key==="?"){i.preventDefault(),window.dispatchEvent(new CustomEvent("squad:dialog:shortcuts")),t=null;return}if(t&&Date.now()-n>CX&&(t=null),t==="g"&&v2[o]){i.preventDefault(),e({to:v2[o]}),t=null;return}if(t==="n"&&o==="s"){i.preventDefault(),e({to:"/stories"}),window.dispatchEvent(new CustomEvent("squad:dialog:new-story")),t=null;return}o==="g"||o==="n"?(t=o,n=Date.now()):t=null};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[e])}const Tn=C.forwardRef(function({className:t="",style:n,...r},i){return g.jsx("div",{ref:i,style:{background:"linear-gradient(90deg, var(--gray-3) 0%, var(--gray-4) 50%, var(--gray-3) 100%)",backgroundSize:"200% 100%",animation:"skeleton-shimmer 1.4s linear infinite",...n},className:`rounded-[var(--radius-sm)] ${t}`,...r})}),EX={default:{fg:"var(--color-text-muted)",bg:"var(--gray-2)",border:"var(--color-border)"},success:{fg:"var(--color-ok)",bg:"var(--color-ok-bg)",border:"var(--color-ok-border)"},warning:{fg:"var(--color-warn)",bg:"var(--color-warn-bg)",border:"var(--color-warn-border)"},danger:{fg:"var(--color-fail)",bg:"var(--color-fail-bg)",border:"var(--color-fail-border)"},info:{fg:"var(--color-info)",bg:"var(--color-info-bg)",border:"var(--color-info-border)"},ok:{fg:"var(--color-ok)",bg:"var(--color-ok-bg)",border:"var(--color-ok-border)"},warn:{fg:"var(--color-warn)",bg:"var(--color-warn-bg)",border:"var(--color-warn-border)"},fail:{fg:"var(--color-fail)",bg:"var(--color-fail-bg)",border:"var(--color-fail-border)"},muted:{fg:"var(--color-text-muted)",bg:"var(--gray-2)",border:"var(--color-border)"}},Ee=C.forwardRef(function({tone:t="default",dot:n,className:r="",children:i,...o},s){const a=EX[t];return g.jsxs("span",{ref:s,style:{color:a.fg,background:a.bg,borderColor:a.border},className:`inline-flex items-center gap-1.5 rounded-[var(--radius-sm)] border px-2 py-0.5 text-[11px] font-medium tabular ${r}`,...o,children:[n?g.jsx("span",{style:{background:a.fg},className:"h-1.5 w-1.5 rounded-full"}):null,i]})}),TX=[{heading:"Workspace",items:[{to:"/",label:"Dashboard",Icon:SF,exact:!0},{to:"/stories",label:"Stories",Icon:YC},{to:"/plans",label:"Plans",Icon:XC}]},{heading:"Run",items:[{to:"/generate",label:"Generate plan",Icon:CF},{to:"/runs",label:"Runs",Icon:sX}]},{heading:"Settings",items:[{to:"/config",label:"Config",Icon:Xf},{to:"/secrets",label:"Secrets",Icon:OF},{to:"/tracker",label:"Tracker",Icon:AF},{to:"/doctor",label:"Doctor",Icon:PF}]}],b2="group flex items-center gap-2.5 rounded-[var(--radius-md)] px-2.5 py-1.5 text-[13px] text-[var(--color-text-muted)] transition-colors hover:bg-[var(--gray-3)] hover:text-[var(--color-text)]",_X="bg-[var(--gray-3)] text-[var(--color-text)]";function jX(e){const t=e.split(/[/\\]/).filter(Boolean);return t.length?t[t.length-1]:e}function MX(e){return/^[\w./:@+-]+$/.test(e)&&!e.includes("'")?e:`'${e.replace(/'/g,"'\\''")}'`}function IX(){const e=yi(),{toast:t}=Qr(),n=wt({queryKey:["meta"],queryFn:()=>Me("/api/meta")}),r=wt({queryKey:["recent-projects"],queryFn:()=>Me("/api/projects/recent")}),[i,o]=C.useState(!1),s=C.useRef(null);C.useEffect(()=>{if(!i)return;const f=h=>{s.current&&!s.current.contains(h.target)&&o(!1)};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[i]);const a=n.data,l=a?.project.name??null,u=a?.root??"";async function c(f){if(!f||f===u){o(!1);return}const h=`cd ${MX(f)} && squad console`;try{await navigator.clipboard.writeText(h),t({tone:"info",title:"Command copied",description:"Run it in another terminal to open this project."})}catch{t({tone:"warning",title:"Copy failed",description:h})}o(!1),e.invalidateQueries({queryKey:["recent-projects"]})}return g.jsxs("aside",{className:"sticky top-0 flex h-screen w-56 shrink-0 flex-col border-r border-[var(--color-border)] bg-[var(--gray-2)] px-3 py-4","aria-label":"Primary navigation",children:[g.jsxs("div",{className:"mb-3 flex items-center gap-2 px-1.5",children:[g.jsx("img",{src:"/logo.svg",alt:"",className:"h-6 w-6"}),g.jsxs("div",{className:"text-sm font-semibold tracking-tight text-[var(--color-text)]",children:["squad ",g.jsx("span",{className:"text-[var(--color-text-muted)]",children:"console"})]})]}),g.jsxs("div",{className:"relative mb-4 px-0.5",ref:s,children:[g.jsxs("button",{type:"button","aria-expanded":i,"aria-haspopup":"listbox",onClick:()=>o(f=>!f),className:"flex w-full items-center gap-2 rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--gray-3)] px-2.5 py-2 text-left text-[13px] text-[var(--color-text)] transition-colors hover:bg-[var(--gray-4)]",children:[g.jsx(oX,{size:14,className:"text-[var(--color-text-dim)]","aria-hidden":!0}),g.jsx("span",{className:"min-w-0 flex-1 truncate",children:n.isPending?g.jsx(Tn,{className:"h-4 w-32"}):l??"—"}),g.jsx(bF,{size:14,className:"text-[var(--color-text-dim)]","aria-hidden":!0})]}),i&&!r.isPending?g.jsx("div",{role:"listbox",className:"absolute left-0 top-full z-[var(--z-overlay)] mt-1 max-h-72 w-full overflow-auto rounded-[var(--radius-md)] border border-[var(--color-border-strong)] bg-[var(--gray-3)] py-1 shadow-2xl",children:r.data&&r.data.length>0?r.data.map(f=>g.jsxs("button",{type:"button",role:"option","aria-selected":f.root===u,onClick:()=>c(f.root),className:"flex w-full flex-col items-start gap-0.5 px-2.5 py-1.5 text-left text-[12px] hover:bg-[var(--gray-4)]",children:[g.jsx("span",{className:"font-medium text-[var(--color-text)]",children:jX(f.root)}),g.jsx("span",{className:"w-full truncate font-mono text-[10px] text-[var(--color-text-dim)]",children:f.root})]},f.root)):g.jsx("div",{className:"px-2.5 py-1.5 text-[12px] text-[var(--color-text-muted)]",children:"No recent projects yet."})}):null]}),g.jsx("nav",{className:"flex-1 space-y-4 overflow-auto",children:TX.map(f=>g.jsxs("div",{children:[g.jsx("div",{className:"mb-1.5 px-2.5 text-[10px] font-semibold uppercase tracking-wider text-[var(--color-text-dim)]",children:f.heading}),g.jsx("ul",{className:"space-y-0.5",children:f.items.map(h=>g.jsx("li",{children:g.jsxs(vt,{to:h.to,className:b2,activeProps:{className:`${b2} ${_X}`},activeOptions:{exact:h.exact??!1},children:[g.jsx(h.Icon,{size:14,className:"text-[var(--color-text-dim)] group-hover:text-[var(--color-text)] group-aria-[current=page]:text-[var(--color-text)]","aria-hidden":!0}),g.jsx("span",{children:h.label})]})},h.to))})]},f.heading))}),g.jsxs("div",{className:"mt-3 space-y-2 border-t border-[var(--color-border)] pt-3 px-1.5",children:[g.jsxs("div",{className:"flex items-center justify-between text-[11px] text-[var(--color-text-dim)]",children:[g.jsxs("span",{children:["v",a?.version??"—"]}),a?.planner?g.jsx(Ee,{tone:a.planner.enabled?"success":"default",dot:a.planner.enabled,children:a.planner.provider}):g.jsx(Ee,{tone:"default",children:"planner off"})]}),g.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-[var(--color-text-dim)]",children:[g.jsx("span",{children:"Search"}),g.jsx(Wi,{children:"⌘K"})]})]})]})}const x2={"/":"Dashboard","/stories":"Stories","/plans":"Plans","/generate":"Generate plan","/config":"Config","/secrets":"Secrets","/tracker":"Tracker","/doctor":"Doctor"};function NX(){const e=kK(),t=[];for(const i of e){const o=i.params??{};if(i.routeId==="__root__")continue;const s=i.pathname;if(x2[s]){t.push({label:x2[s],to:s});continue}if(s.startsWith("/stories/")&&o.feature&&o.id){t.push({label:"Stories",to:"/stories"}),t.push({label:o.feature,to:"/stories"}),t.push({label:o.id,to:s});continue}if(s.startsWith("/plans/")&&s.endsWith("/diff")&&o.feature){t.push({label:"Plans",to:"/plans"}),t.push({label:o.feature,to:"/plans"}),t.push({label:"diff",to:s});continue}if(s.startsWith("/plans/")&&o.feature&&o.planFile){t.push({label:"Plans",to:"/plans"}),t.push({label:o.feature,to:"/plans"}),t.push({label:o.planFile,to:s});continue}}const n=new Set,r=t.filter(i=>{const o=`${i.label}|${i.to}`;return n.has(o)?!1:(n.add(o),!0)});return r.length===0?null:g.jsx("nav",{"aria-label":"Breadcrumbs",className:"flex min-w-0 items-center gap-1 text-[13px]",children:r.map((i,o)=>{const s=o===r.length-1;return g.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[o>0?g.jsx(tX,{size:12,className:"text-[var(--color-text-dim)]","aria-hidden":!0}):null,s?g.jsx("span",{className:"truncate font-medium text-[var(--color-text)]",children:i.label}):g.jsx(vt,{to:i.to,className:"truncate text-[var(--color-text-muted)] transition-colors hover:text-[var(--color-text)]",children:i.label})]},`${i.to}-${o}`)})})}function Wg({label:e,children:t,side:n="top",delay:r=250}){const i=C.useId(),[o,s]=C.useState(!1),a=C.useRef(null),l=C.useCallback(()=>{a.current!==null&&window.clearTimeout(a.current),a.current=window.setTimeout(()=>{a.current=null,s(!0)},r)},[r]),u=C.useCallback(()=>{a.current!==null&&(window.clearTimeout(a.current),a.current=null),s(!1)},[]);return C.useEffect(()=>()=>{a.current!==null&&window.clearTimeout(a.current)},[]),g.jsxs("span",{className:"relative inline-flex",children:[g.jsx("span",{onMouseEnter:l,onMouseLeave:u,onFocus:l,onBlur:u,"aria-describedby":o?i:void 0,className:"inline-flex",children:t}),o?g.jsx("span",{id:i,role:"tooltip",className:`pointer-events-none absolute left-1/2 z-[var(--z-tooltip)] -translate-x-1/2 ${n==="top"?"bottom-full mb-1":"top-full mt-1"} whitespace-nowrap rounded-[var(--radius-sm)] border border-[var(--color-border-strong)] bg-[var(--gray-2)] px-2 py-1 text-[11px] text-[var(--color-text)] shadow-lg animate-fade-in`,children:e}):null]})}function RX(){const{density:e,setDensity:t}=jF();return g.jsxs("div",{role:"group","aria-label":"Density",className:"inline-flex overflow-hidden rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--gray-3)]",children:[g.jsx(Wg,{label:"Comfortable",children:g.jsx("button",{type:"button","aria-pressed":e==="comfortable",onClick:()=>t("comfortable"),className:e==="comfortable"?"flex h-7 w-7 items-center justify-center bg-[var(--gray-4)] text-[var(--color-text)]":"flex h-7 w-7 items-center justify-center text-[var(--color-text-dim)] hover:text-[var(--color-text)]",children:g.jsx(aX,{size:12,"aria-hidden":!0})})}),g.jsx(Wg,{label:"Compact",children:g.jsx("button",{type:"button","aria-pressed":e==="compact",onClick:()=>t("compact"),className:e==="compact"?"flex h-7 w-7 items-center justify-center bg-[var(--gray-4)] text-[var(--color-text)]":"flex h-7 w-7 items-center justify-center text-[var(--color-text-dim)] hover:text-[var(--color-text)]",children:g.jsx(lX,{size:12,"aria-hidden":!0})})})]})}function DX(){return g.jsxs("header",{className:"sticky top-0 z-[var(--z-sticky)] flex h-12 items-center justify-between gap-4 border-b border-[var(--color-border)] bg-[var(--color-bg)]/85 px-6 backdrop-blur-sm lg:px-8",children:[g.jsx(NX,{}),g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsxs("button",{type:"button","aria-label":"Open command palette (⌘K)",onClick:()=>{window.dispatchEvent(new CustomEvent("squad:cmdk:open"))},className:"hidden items-center gap-2 rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--gray-3)] px-2.5 py-1 text-[12px] text-[var(--color-text-muted)] hover:border-[var(--color-border-strong)] hover:text-[var(--color-text)] sm:inline-flex",children:[g.jsx("span",{children:"Search…"}),g.jsx(Wi,{children:"⌘K"})]}),g.jsx(RX,{}),g.jsx(Ee,{tone:"success",dot:!0,children:"session"})]})]})}function LX(){return PX(),g.jsx("div",{className:"min-h-screen bg-[var(--color-bg)] text-[var(--color-text)]",children:g.jsxs("div",{className:"flex",children:[g.jsx(IX,{}),g.jsxs("div",{className:"flex min-h-screen flex-1 flex-col",children:[g.jsx(DX,{}),g.jsx("main",{className:"flex-1",children:g.jsx("div",{className:"mx-auto w-full max-w-screen-2xl px-6 py-6 lg:px-8",children:g.jsx(NB,{})})})]})]})})}const $X={default:{fg:"var(--color-text)",bg:"var(--gray-2)",border:"var(--color-border)",icon:g.jsx(Kw,{size:14,className:"text-[var(--color-text-muted)]","aria-hidden":!0})},info:{fg:"var(--color-text)",bg:"var(--color-info-bg)",border:"var(--color-info-border)",icon:g.jsx(Kw,{size:14,className:"text-[var(--color-info)]","aria-hidden":!0})},success:{fg:"var(--color-text)",bg:"var(--color-ok-bg)",border:"var(--color-ok-border)",icon:g.jsx(xF,{size:14,className:"text-[var(--color-ok)]","aria-hidden":!0})},warning:{fg:"var(--color-text)",bg:"var(--color-warn-bg)",border:"var(--color-warn-border)",icon:g.jsx(EF,{size:14,className:"text-[var(--color-warn)]","aria-hidden":!0})},danger:{fg:"var(--color-text)",bg:"var(--color-fail-bg)",border:"var(--color-fail-border)",icon:g.jsx(t0,{size:14,className:"text-[var(--color-fail)]","aria-hidden":!0})}};function Ae({tone:e="default",title:t,icon:n,action:r,children:i,className:o=""}){const s=$X[e];return g.jsxs("div",{role:e==="danger"||e==="warning"?"alert":"note",style:{background:s.bg,borderColor:s.border,color:s.fg},className:`flex gap-3 rounded-[var(--radius-md)] border px-3 py-2.5 text-sm ${o}`,children:[g.jsx("div",{className:"mt-0.5",children:n??s.icon}),g.jsxs("div",{className:"min-w-0 flex-1",children:[t?g.jsx("div",{className:"font-medium",children:t}):null,i?g.jsx("div",{className:`text-[13px] ${t?"mt-0.5 text-[var(--color-text-muted)]":""}`,children:i}):null]}),r?g.jsx("div",{className:"shrink-0",children:r}):null]})}const BX={default:"bg-[var(--color-surface)] border border-[var(--color-border)]",flat:"bg-transparent border border-[var(--color-border)]",inset:"bg-[var(--gray-2)] border border-[var(--color-border)]"},He=C.forwardRef(function({variant:t="default",interactive:n,header:r,footer:i,className:o="",children:s,...a},l){return g.jsxs("div",{ref:l,"data-interactive":n||void 0,className:`${BX[t]} rounded-[var(--radius-md)] data-[interactive]:transition-colors data-[interactive]:hover:border-[var(--color-border-strong)] ${o}`,...a,children:[r?g.jsx("div",{className:"border-b border-[var(--color-border)] px-[var(--space-card)] py-3 text-sm font-medium text-[var(--color-text)]",children:r}):null,g.jsx("div",{className:"p-[var(--space-card)]",children:s}),i?g.jsx("div",{className:"border-t border-[var(--color-border)] px-[var(--space-card)] py-3 text-sm text-[var(--color-text-muted)]",children:i}):null]})});function Ce({title:e,description:t,actions:n,breadcrumbs:r,children:i}){return g.jsxs("section",{className:"flex flex-col",children:[r?g.jsx("div",{className:"mb-3",children:r}):null,g.jsxs("header",{className:"mb-6 flex flex-wrap items-start justify-between gap-4",children:[g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("h1",{className:"text-[var(--font-size-h1)] font-semibold tracking-tight text-[var(--color-text)]",style:{letterSpacing:"-0.015em"},children:e}),t?g.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:t}):null]}),n?g.jsx("div",{className:"flex shrink-0 items-center gap-2",children:n}):null]}),g.jsx("div",{className:"flex flex-col gap-[var(--space-section)]",children:i})]})}function NF(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=NF(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Se(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=NF(e))&&(r&&(r+=" "),r+=t);return r}var FX=Array.isArray,rr=FX,zX=typeof ts=="object"&&ts&&ts.Object===Object&&ts,RF=zX,WX=RF,UX=typeof self=="object"&&self&&self.Object===Object&&self,HX=WX||UX||Function("return this")(),Yi=HX,VX=Yi,qX=VX.Symbol,Zd=qX,w2=Zd,DF=Object.prototype,KX=DF.hasOwnProperty,GX=DF.toString,ff=w2?w2.toStringTag:void 0;function QX(e){var t=KX.call(e,ff),n=e[ff];try{e[ff]=void 0;var r=!0}catch{}var i=GX.call(e);return r&&(t?e[ff]=n:delete e[ff]),i}var XX=QX,YX=Object.prototype,ZX=YX.toString;function JX(e){return ZX.call(e)}var eY=JX,S2=Zd,tY=XX,nY=eY,rY="[object Null]",iY="[object Undefined]",k2=S2?S2.toStringTag:void 0;function oY(e){return e==null?e===void 0?iY:rY:k2&&k2 in Object(e)?tY(e):nY(e)}var Bo=oY;function sY(e){return e!=null&&typeof e=="object"}var Fo=sY,aY=Bo,lY=Fo,uY="[object Symbol]";function cY(e){return typeof e=="symbol"||lY(e)&&aY(e)==uY}var _c=cY,fY=rr,hY=_c,dY=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pY=/^\w*$/;function mY(e,t){if(fY(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||hY(e)?!0:pY.test(e)||!dY.test(e)||t!=null&&e in Object(t)}var JC=mY;function gY(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Ws=gY;const jc=ze(Ws);var yY=Bo,vY=Ws,bY="[object AsyncFunction]",xY="[object Function]",wY="[object GeneratorFunction]",SY="[object Proxy]";function kY(e){if(!vY(e))return!1;var t=yY(e);return t==xY||t==wY||t==bY||t==SY}var eA=kY;const xe=ze(eA);var OY=Yi,CY=OY["__core-js_shared__"],AY=CY,dx=AY,O2=function(){var e=/[^.]+$/.exec(dx&&dx.keys&&dx.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function PY(e){return!!O2&&O2 in e}var EY=PY,TY=Function.prototype,_Y=TY.toString;function jY(e){if(e!=null){try{return _Y.call(e)}catch{}try{return e+""}catch{}}return""}var LF=jY,MY=eA,IY=EY,NY=Ws,RY=LF,DY=/[\\^$.*+?()[\]{}|]/g,LY=/^\[object .+?Constructor\]$/,$Y=Function.prototype,BY=Object.prototype,FY=$Y.toString,zY=BY.hasOwnProperty,WY=RegExp("^"+FY.call(zY).replace(DY,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function UY(e){if(!NY(e)||IY(e))return!1;var t=MY(e)?WY:LY;return t.test(RY(e))}var HY=UY;function VY(e,t){return e?.[t]}var qY=VY,KY=HY,GY=qY;function QY(e,t){var n=GY(e,t);return KY(n)?n:void 0}var hl=QY,XY=hl,YY=XY(Object,"create"),i0=YY,C2=i0;function ZY(){this.__data__=C2?C2(null):{},this.size=0}var JY=ZY;function eZ(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var tZ=eZ,nZ=i0,rZ="__lodash_hash_undefined__",iZ=Object.prototype,oZ=iZ.hasOwnProperty;function sZ(e){var t=this.__data__;if(nZ){var n=t[e];return n===rZ?void 0:n}return oZ.call(t,e)?t[e]:void 0}var aZ=sZ,lZ=i0,uZ=Object.prototype,cZ=uZ.hasOwnProperty;function fZ(e){var t=this.__data__;return lZ?t[e]!==void 0:cZ.call(t,e)}var hZ=fZ,dZ=i0,pZ="__lodash_hash_undefined__";function mZ(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=dZ&&t===void 0?pZ:t,this}var gZ=mZ,yZ=JY,vZ=tZ,bZ=aZ,xZ=hZ,wZ=gZ;function Mc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Mc.prototype.clear=yZ;Mc.prototype.delete=vZ;Mc.prototype.get=bZ;Mc.prototype.has=xZ;Mc.prototype.set=wZ;var SZ=Mc;function kZ(){this.__data__=[],this.size=0}var OZ=kZ;function CZ(e,t){return e===t||e!==e&&t!==t}var tA=CZ,AZ=tA;function PZ(e,t){for(var n=e.length;n--;)if(AZ(e[n][0],t))return n;return-1}var o0=PZ,EZ=o0,TZ=Array.prototype,_Z=TZ.splice;function jZ(e){var t=this.__data__,n=EZ(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():_Z.call(t,n,1),--this.size,!0}var MZ=jZ,IZ=o0;function NZ(e){var t=this.__data__,n=IZ(t,e);return n<0?void 0:t[n][1]}var RZ=NZ,DZ=o0;function LZ(e){return DZ(this.__data__,e)>-1}var $Z=LZ,BZ=o0;function FZ(e,t){var n=this.__data__,r=BZ(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var zZ=FZ,WZ=OZ,UZ=MZ,HZ=RZ,VZ=$Z,qZ=zZ;function Ic(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ic.prototype.clear=WZ;Ic.prototype.delete=UZ;Ic.prototype.get=HZ;Ic.prototype.has=VZ;Ic.prototype.set=qZ;var s0=Ic,KZ=hl,GZ=Yi,QZ=KZ(GZ,"Map"),nA=QZ,A2=SZ,XZ=s0,YZ=nA;function ZZ(){this.size=0,this.__data__={hash:new A2,map:new(YZ||XZ),string:new A2}}var JZ=ZZ;function eJ(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var tJ=eJ,nJ=tJ;function rJ(e,t){var n=e.__data__;return nJ(t)?n[typeof t=="string"?"string":"hash"]:n.map}var a0=rJ,iJ=a0;function oJ(e){var t=iJ(this,e).delete(e);return this.size-=t?1:0,t}var sJ=oJ,aJ=a0;function lJ(e){return aJ(this,e).get(e)}var uJ=lJ,cJ=a0;function fJ(e){return cJ(this,e).has(e)}var hJ=fJ,dJ=a0;function pJ(e,t){var n=dJ(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var mJ=pJ,gJ=JZ,yJ=sJ,vJ=uJ,bJ=hJ,xJ=mJ;function Nc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Nc.prototype.clear=gJ;Nc.prototype.delete=yJ;Nc.prototype.get=vJ;Nc.prototype.has=bJ;Nc.prototype.set=xJ;var rA=Nc,$F=rA,wJ="Expected a function";function iA(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(wJ);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(iA.Cache||$F),n}iA.Cache=$F;var BF=iA;const SJ=ze(BF);var kJ=BF,OJ=500;function CJ(e){var t=kJ(e,function(r){return n.size===OJ&&n.clear(),r}),n=t.cache;return t}var AJ=CJ,PJ=AJ,EJ=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,TJ=/\\(\\)?/g,_J=PJ(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(EJ,function(n,r,i,o){t.push(i?o.replace(TJ,"$1"):r||n)}),t}),jJ=_J;function MJ(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var oA=MJ,P2=Zd,IJ=oA,NJ=rr,RJ=_c,E2=P2?P2.prototype:void 0,T2=E2?E2.toString:void 0;function FF(e){if(typeof e=="string")return e;if(NJ(e))return IJ(e,FF)+"";if(RJ(e))return T2?T2.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var DJ=FF,LJ=DJ;function $J(e){return e==null?"":LJ(e)}var zF=$J,BJ=rr,FJ=JC,zJ=jJ,WJ=zF;function UJ(e,t){return BJ(e)?e:FJ(e,t)?[e]:zJ(WJ(e))}var WF=UJ,HJ=_c;function VJ(e){if(typeof e=="string"||HJ(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var l0=VJ,qJ=WF,KJ=l0;function GJ(e,t){t=qJ(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[KJ(t[n++])];return n&&n==r?e:void 0}var sA=GJ,QJ=sA;function XJ(e,t,n){var r=e==null?void 0:QJ(e,t);return r===void 0?n:r}var UF=XJ;const Or=ze(UF);function YJ(e){return e==null}var ZJ=YJ;const we=ze(ZJ);var JJ=Bo,eee=rr,tee=Fo,nee="[object String]";function ree(e){return typeof e=="string"||!eee(e)&&tee(e)&&JJ(e)==nee}var iee=ree;const Ya=ze(iee);var HF={exports:{}},qe={};/**
|
|
286
|
-
* @license React
|
|
287
|
-
* react-is.production.min.js
|
|
288
|
-
*
|
|
289
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
290
|
-
*
|
|
291
|
-
* This source code is licensed under the MIT license found in the
|
|
292
|
-
* LICENSE file in the root directory of this source tree.
|
|
293
|
-
*/var aA=Symbol.for("react.element"),lA=Symbol.for("react.portal"),u0=Symbol.for("react.fragment"),c0=Symbol.for("react.strict_mode"),f0=Symbol.for("react.profiler"),h0=Symbol.for("react.provider"),d0=Symbol.for("react.context"),oee=Symbol.for("react.server_context"),p0=Symbol.for("react.forward_ref"),m0=Symbol.for("react.suspense"),g0=Symbol.for("react.suspense_list"),y0=Symbol.for("react.memo"),v0=Symbol.for("react.lazy"),see=Symbol.for("react.offscreen"),VF;VF=Symbol.for("react.module.reference");function Xr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case aA:switch(e=e.type,e){case u0:case f0:case c0:case m0:case g0:return e;default:switch(e=e&&e.$$typeof,e){case oee:case d0:case p0:case v0:case y0:case h0:return e;default:return t}}case lA:return t}}}qe.ContextConsumer=d0;qe.ContextProvider=h0;qe.Element=aA;qe.ForwardRef=p0;qe.Fragment=u0;qe.Lazy=v0;qe.Memo=y0;qe.Portal=lA;qe.Profiler=f0;qe.StrictMode=c0;qe.Suspense=m0;qe.SuspenseList=g0;qe.isAsyncMode=function(){return!1};qe.isConcurrentMode=function(){return!1};qe.isContextConsumer=function(e){return Xr(e)===d0};qe.isContextProvider=function(e){return Xr(e)===h0};qe.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===aA};qe.isForwardRef=function(e){return Xr(e)===p0};qe.isFragment=function(e){return Xr(e)===u0};qe.isLazy=function(e){return Xr(e)===v0};qe.isMemo=function(e){return Xr(e)===y0};qe.isPortal=function(e){return Xr(e)===lA};qe.isProfiler=function(e){return Xr(e)===f0};qe.isStrictMode=function(e){return Xr(e)===c0};qe.isSuspense=function(e){return Xr(e)===m0};qe.isSuspenseList=function(e){return Xr(e)===g0};qe.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===u0||e===f0||e===c0||e===m0||e===g0||e===see||typeof e=="object"&&e!==null&&(e.$$typeof===v0||e.$$typeof===y0||e.$$typeof===h0||e.$$typeof===d0||e.$$typeof===p0||e.$$typeof===VF||e.getModuleId!==void 0)};qe.typeOf=Xr;HF.exports=qe;var aee=HF.exports,lee=Bo,uee=Fo,cee="[object Number]";function fee(e){return typeof e=="number"||uee(e)&&lee(e)==cee}var qF=fee;const hee=ze(qF);var dee=qF;function pee(e){return dee(e)&&e!=+e}var mee=pee;const Jd=ze(mee);var Mn=function(t){return t===0?0:t>0?1:-1},Sa=function(t){return Ya(t)&&t.indexOf("%")===t.length-1},ne=function(t){return hee(t)&&!Jd(t)},gee=function(t){return we(t)},qt=function(t){return ne(t)||Ya(t)},yee=0,Rc=function(t){var n=++yee;return"".concat(t||"").concat(n)},In=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ne(t)&&!Ya(t))return r;var o;if(Sa(t)){var s=t.indexOf("%");o=n*parseFloat(t.slice(0,s))/100}else o=+t;return Jd(o)&&(o=r),i&&o>n&&(o=n),o},Dl=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},vee=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},i=0;i<n;i++)if(!r[t[i]])r[t[i]]=!0;else return!0;return!1},yr=function(t,n){return ne(t)&&ne(n)?function(r){return t+r*(n-t)}:function(){return n}};function Ug(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):Or(r,t))===n})}var bee=function(t,n){return ne(t)&&ne(n)?t-n:Ya(t)&&Ya(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function bu(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function Gw(e){"@babel/helpers - typeof";return Gw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gw(e)}var xee=["viewBox","children"],wee=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],_2=["points","pathLength"],px={svg:xee,polygon:_2,polyline:_2},uA=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],Hg=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(C.isValidElement(t)&&(r=t.props),!jc(r))return null;var i={};return Object.keys(r).forEach(function(o){uA.includes(o)&&(i[o]=n||function(s){return r[o](r,s)})}),i},See=function(t,n,r){return function(i){return t(n,r,i),null}},Za=function(t,n,r){if(!jc(t)||Gw(t)!=="object")return null;var i=null;return Object.keys(t).forEach(function(o){var s=t[o];uA.includes(o)&&typeof s=="function"&&(i||(i={}),i[o]=See(s,n,r))}),i},kee=["children"],Oee=["children"];function j2(e,t){if(e==null)return{};var n=Cee(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Cee(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Qw(e){"@babel/helpers - typeof";return Qw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qw(e)}var M2={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},xo=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},I2=null,mx=null,cA=function e(t){if(t===I2&&Array.isArray(mx))return mx;var n=[];return C.Children.forEach(t,function(r){we(r)||(aee.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),mx=n,I2=t,n};function Cr(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return xo(i)}):r=[xo(t)],cA(e).forEach(function(i){var o=Or(i,"type.displayName")||Or(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}function pr(e,t){var n=Cr(e,t);return n&&n[0]}var N2=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!ne(r)||r<=0||!ne(i)||i<=0)},Aee=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],Pee=function(t){return t&&t.type&&Ya(t.type)&&Aee.indexOf(t.type)>=0},Eee=function(t){return t&&Qw(t)==="object"&&"clipDot"in t},Tee=function(t,n,r,i){var o,s=(o=px?.[i])!==null&&o!==void 0?o:[];return n.startsWith("data-")||!xe(t)&&(i&&s.includes(n)||wee.includes(n))||r&&uA.includes(n)},pe=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(C.isValidElement(t)&&(i=t.props),!jc(i))return null;var o={};return Object.keys(i).forEach(function(s){var a;Tee((a=i)===null||a===void 0?void 0:a[s],s,n,r)&&(o[s]=i[s])}),o},Xw=function e(t,n){if(t===n)return!0;var r=C.Children.count(t);if(r!==C.Children.count(n))return!1;if(r===0)return!0;if(r===1)return R2(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i<r;i++){var o=t[i],s=n[i];if(Array.isArray(o)||Array.isArray(s)){if(!e(o,s))return!1}else if(!R2(o,s))return!1}return!0},R2=function(t,n){if(we(t)&&we(n))return!0;if(!we(t)&&!we(n)){var r=t.props||{},i=r.children,o=j2(r,kee),s=n.props||{},a=s.children,l=j2(s,Oee);return i&&a?bu(o,l)&&Xw(i,a):!i&&!a?bu(o,l):!1}return!1},D2=function(t,n){var r=[],i={};return cA(t).forEach(function(o,s){if(Pee(o))r.push(o);else if(o){var a=xo(o.type),l=n[a]||{},u=l.handler,c=l.once;if(u&&(!c||!i[a])){var f=u(o,a,s);r.push(f),i[a]=!0}}}),r},_ee=function(t){var n=t&&t.type;return n&&M2[n]?M2[n]:null},jee=function(t,n){return cA(n).indexOf(t)},Mee=["children","width","height","viewBox","className","style","title","desc"];function Yw(){return Yw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yw.apply(this,arguments)}function Iee(e,t){if(e==null)return{};var n=Nee(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Nee(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Zw(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,o=e.className,s=e.style,a=e.title,l=e.desc,u=Iee(e,Mee),c=i||{width:n,height:r,x:0,y:0},f=Se("recharts-surface",o);return L.createElement("svg",Yw({},pe(u,!0,"svg"),{className:f,width:n,height:r,style:s,viewBox:"".concat(c.x," ").concat(c.y," ").concat(c.width," ").concat(c.height)}),L.createElement("title",null,a),L.createElement("desc",null,l),t)}var Ree=["children","className"];function Jw(){return Jw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jw.apply(this,arguments)}function Dee(e,t){if(e==null)return{};var n=Lee(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Lee(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var $e=L.forwardRef(function(e,t){var n=e.children,r=e.className,i=Dee(e,Ree),o=Se("recharts-layer",r);return L.createElement("g",Jw({className:o},pe(i,!0),{ref:t}),n)}),wo=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o]};function $ee(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}var Bee=$ee,Fee=Bee;function zee(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:Fee(e,t,n)}var Wee=zee,Uee="\\ud800-\\udfff",Hee="\\u0300-\\u036f",Vee="\\ufe20-\\ufe2f",qee="\\u20d0-\\u20ff",Kee=Hee+Vee+qee,Gee="\\ufe0e\\ufe0f",Qee="\\u200d",Xee=RegExp("["+Qee+Uee+Kee+Gee+"]");function Yee(e){return Xee.test(e)}var KF=Yee;function Zee(e){return e.split("")}var Jee=Zee,GF="\\ud800-\\udfff",ete="\\u0300-\\u036f",tte="\\ufe20-\\ufe2f",nte="\\u20d0-\\u20ff",rte=ete+tte+nte,ite="\\ufe0e\\ufe0f",ote="["+GF+"]",eS="["+rte+"]",tS="\\ud83c[\\udffb-\\udfff]",ste="(?:"+eS+"|"+tS+")",QF="[^"+GF+"]",XF="(?:\\ud83c[\\udde6-\\uddff]){2}",YF="[\\ud800-\\udbff][\\udc00-\\udfff]",ate="\\u200d",ZF=ste+"?",JF="["+ite+"]?",lte="(?:"+ate+"(?:"+[QF,XF,YF].join("|")+")"+JF+ZF+")*",ute=JF+ZF+lte,cte="(?:"+[QF+eS+"?",eS,XF,YF,ote].join("|")+")",fte=RegExp(tS+"(?="+tS+")|"+cte+ute,"g");function hte(e){return e.match(fte)||[]}var dte=hte,pte=Jee,mte=KF,gte=dte;function yte(e){return mte(e)?gte(e):pte(e)}var vte=yte,bte=Wee,xte=KF,wte=vte,Ste=zF;function kte(e){return function(t){t=Ste(t);var n=xte(t)?wte(t):void 0,r=n?n[0]:t.charAt(0),i=n?bte(n,1).join(""):t.slice(1);return r[e]()+i}}var Ote=kte,Cte=Ote,Ate=Cte("toUpperCase"),Pte=Ate;const b0=ze(Pte);function nt(e){return function(){return e}}const e3=Math.cos,Vg=Math.sin,bi=Math.sqrt,qg=Math.PI,x0=2*qg,nS=Math.PI,rS=2*nS,la=1e-6,Ete=rS-la;function t3(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Tte(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return t3;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class _te{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?t3:Tte(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,s){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+s}`}arcTo(t,n,r,i,o){if(t=+t,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let s=this._x1,a=this._y1,l=r-t,u=i-n,c=s-t,f=a-n,h=c*c+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>la)if(!(Math.abs(f*l-u*c)>la)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let d=r-s,p=i-a,m=l*l+u*u,v=d*d+p*p,b=Math.sqrt(m),y=Math.sqrt(h),x=o*Math.tan((nS-Math.acos((m+h-v)/(2*b*y)))/2),k=x/y,w=x/b;Math.abs(k-1)>la&&this._append`L${t+k*c},${n+k*f}`,this._append`A${o},${o},0,0,${+(f*d>c*p)},${this._x1=t+w*l},${this._y1=n+w*u}`}}arc(t,n,r,i,o,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),l=r*Math.sin(i),u=t+a,c=n+l,f=1^s,h=s?i-o:o-i;this._x1===null?this._append`M${u},${c}`:(Math.abs(this._x1-u)>la||Math.abs(this._y1-c)>la)&&this._append`L${u},${c}`,r&&(h<0&&(h=h%rS+rS),h>Ete?this._append`A${r},${r},0,1,${f},${t-a},${n-l}A${r},${r},0,1,${f},${this._x1=u},${this._y1=c}`:h>la&&this._append`A${r},${r},0,${+(h>=nS)},${f},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function fA(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new _te(t)}function hA(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function n3(e){this._context=e}n3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function w0(e){return new n3(e)}function r3(e){return e[0]}function i3(e){return e[1]}function o3(e,t){var n=nt(!0),r=null,i=w0,o=null,s=fA(a);e=typeof e=="function"?e:e===void 0?r3:nt(e),t=typeof t=="function"?t:t===void 0?i3:nt(t);function a(l){var u,c=(l=hA(l)).length,f,h=!1,d;for(r==null&&(o=i(d=s())),u=0;u<=c;++u)!(u<c&&n(f=l[u],u,l))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+e(f,u,l),+t(f,u,l));if(d)return o=null,d+""||null}return a.x=function(l){return arguments.length?(e=typeof l=="function"?l:nt(+l),a):e},a.y=function(l){return arguments.length?(t=typeof l=="function"?l:nt(+l),a):t},a.defined=function(l){return arguments.length?(n=typeof l=="function"?l:nt(!!l),a):n},a.curve=function(l){return arguments.length?(i=l,r!=null&&(o=i(r)),a):i},a.context=function(l){return arguments.length?(l==null?r=o=null:o=i(r=l),a):r},a}function Up(e,t,n){var r=null,i=nt(!0),o=null,s=w0,a=null,l=fA(u);e=typeof e=="function"?e:e===void 0?r3:nt(+e),t=typeof t=="function"?t:nt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?i3:nt(+n);function u(f){var h,d,p,m=(f=hA(f)).length,v,b=!1,y,x=new Array(m),k=new Array(m);for(o==null&&(a=s(y=l())),h=0;h<=m;++h){if(!(h<m&&i(v=f[h],h,f))===b)if(b=!b)d=h,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),p=h-1;p>=d;--p)a.point(x[p],k[p]);a.lineEnd(),a.areaEnd()}b&&(x[h]=+e(v,h,f),k[h]=+t(v,h,f),a.point(r?+r(v,h,f):x[h],n?+n(v,h,f):k[h]))}if(y)return a=null,y+""||null}function c(){return o3().defined(i).curve(s).context(o)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:nt(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:nt(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:nt(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:nt(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:nt(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:nt(+f),u):n},u.lineX0=u.lineY0=function(){return c().x(e).y(t)},u.lineY1=function(){return c().x(e).y(n)},u.lineX1=function(){return c().x(r).y(t)},u.defined=function(f){return arguments.length?(i=typeof f=="function"?f:nt(!!f),u):i},u.curve=function(f){return arguments.length?(s=f,o!=null&&(a=s(o)),u):s},u.context=function(f){return arguments.length?(f==null?o=a=null:a=s(o=f),u):o},u}class s3{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function jte(e){return new s3(e,!0)}function Mte(e){return new s3(e,!1)}const dA={draw(e,t){const n=bi(t/qg);e.moveTo(n,0),e.arc(0,0,n,0,x0)}},Ite={draw(e,t){const n=bi(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},a3=bi(1/3),Nte=a3*2,Rte={draw(e,t){const n=bi(t/Nte),r=n*a3;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Dte={draw(e,t){const n=bi(t),r=-n/2;e.rect(r,r,n,n)}},Lte=.8908130915292852,l3=Vg(qg/10)/Vg(7*qg/10),$te=Vg(x0/10)*l3,Bte=-e3(x0/10)*l3,Fte={draw(e,t){const n=bi(t*Lte),r=$te*n,i=Bte*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){const s=x0*o/5,a=e3(s),l=Vg(s);e.lineTo(l*n,-a*n),e.lineTo(a*r-l*i,l*r+a*i)}e.closePath()}},gx=bi(3),zte={draw(e,t){const n=-bi(t/(gx*3));e.moveTo(0,n*2),e.lineTo(-gx*n,-n),e.lineTo(gx*n,-n),e.closePath()}},Mr=-.5,Ir=bi(3)/2,iS=1/bi(12),Wte=(iS/2+1)*3,Ute={draw(e,t){const n=bi(t/Wte),r=n/2,i=n*iS,o=r,s=n*iS+n,a=-o,l=s;e.moveTo(r,i),e.lineTo(o,s),e.lineTo(a,l),e.lineTo(Mr*r-Ir*i,Ir*r+Mr*i),e.lineTo(Mr*o-Ir*s,Ir*o+Mr*s),e.lineTo(Mr*a-Ir*l,Ir*a+Mr*l),e.lineTo(Mr*r+Ir*i,Mr*i-Ir*r),e.lineTo(Mr*o+Ir*s,Mr*s-Ir*o),e.lineTo(Mr*a+Ir*l,Mr*l-Ir*a),e.closePath()}};function Hte(e,t){let n=null,r=fA(i);e=typeof e=="function"?e:nt(e||dA),t=typeof t=="function"?t:nt(t===void 0?64:+t);function i(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:nt(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:nt(+o),i):t},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function Kg(){}function Gg(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function u3(e){this._context=e}u3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Gg(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Gg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Vte(e){return new u3(e)}function c3(e){this._context=e}c3.prototype={areaStart:Kg,areaEnd:Kg,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Gg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function qte(e){return new c3(e)}function f3(e){this._context=e}f3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Gg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Kte(e){return new f3(e)}function h3(e){this._context=e}h3.prototype={areaStart:Kg,areaEnd:Kg,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Gte(e){return new h3(e)}function L2(e){return e<0?-1:1}function $2(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),a=(o*i+s*r)/(r+i);return(L2(o)+L2(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function B2(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function yx(e,t,n){var r=e._x0,i=e._y0,o=e._x1,s=e._y1,a=(o-r)/3;e._context.bezierCurveTo(r+a,i+a*t,o-a,s-a*n,o,s)}function Qg(e){this._context=e}Qg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:yx(this,this._t0,B2(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,yx(this,B2(this,n=$2(this,e,t)),n);break;default:yx(this,this._t0,n=$2(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function d3(e){this._context=new p3(e)}(d3.prototype=Object.create(Qg.prototype)).point=function(e,t){Qg.prototype.point.call(this,t,e)};function p3(e){this._context=e}p3.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function Qte(e){return new Qg(e)}function Xte(e){return new d3(e)}function m3(e){this._context=e}m3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=F2(e),i=F2(t),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[s],t[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function F2(e){var t,n=e.length-1,r,i=new Array(n),o=new Array(n),s=new Array(n);for(i[0]=0,o[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,o[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,o[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/o[t-1],o[t]-=r,s[t]-=r*s[t-1];for(i[n-1]=s[n-1]/o[n-1],t=n-2;t>=0;--t)i[t]=(s[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function Yte(e){return new m3(e)}function S0(e,t){this._context=e,this._t=t}S0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function Zte(e){return new S0(e,.5)}function Jte(e){return new S0(e,0)}function ene(e){return new S0(e,1)}function Wu(e,t){if((s=e.length)>1)for(var n=1,r,i,o=e[t[0]],s,a=o.length;n<s;++n)for(i=o,o=e[t[n]],r=0;r<a;++r)o[r][1]+=o[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function oS(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function tne(e,t){return e[t]}function nne(e){const t=[];return t.key=e,t}function rne(){var e=nt([]),t=oS,n=Wu,r=tne;function i(o){var s=Array.from(e.apply(this,arguments),nne),a,l=s.length,u=-1,c;for(const f of o)for(a=0,++u;a<l;++a)(s[a][u]=[0,+r(f,s[a].key,u,o)]).data=f;for(a=0,c=hA(t(s));a<l;++a)s[c[a]].index=a;return n(s,c),s}return i.keys=function(o){return arguments.length?(e=typeof o=="function"?o:nt(Array.from(o)),i):e},i.value=function(o){return arguments.length?(r=typeof o=="function"?o:nt(+o),i):r},i.order=function(o){return arguments.length?(t=o==null?oS:typeof o=="function"?o:nt(Array.from(o)),i):t},i.offset=function(o){return arguments.length?(n=o??Wu,i):n},i}function ine(e,t){if((r=e.length)>0){for(var n,r,i=0,o=e[0].length,s;i<o;++i){for(s=n=0;n<r;++n)s+=e[n][i][1]||0;if(s)for(n=0;n<r;++n)e[n][i][1]/=s}Wu(e,t)}}function one(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,o=r.length;n<o;++n){for(var s=0,a=0;s<i;++s)a+=e[s][n][1]||0;r[n][1]+=r[n][0]=-a/2}Wu(e,t)}}function sne(e,t){if(!(!((s=e.length)>0)||!((o=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,o,s;r<o;++r){for(var a=0,l=0,u=0;a<s;++a){for(var c=e[t[a]],f=c[r][1]||0,h=c[r-1][1]||0,d=(f-h)/2,p=0;p<a;++p){var m=e[t[p]],v=m[r][1]||0,b=m[r-1][1]||0;d+=v-b}l+=f,u+=d*f}i[r-1][1]+=i[r-1][0]=n,l&&(n-=u/l)}i[r-1][1]+=i[r-1][0]=n,Wu(e,t)}}function Wh(e){"@babel/helpers - typeof";return Wh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wh(e)}var ane=["type","size","sizeType"];function sS(){return sS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sS.apply(this,arguments)}function z2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function W2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?z2(Object(n),!0).forEach(function(r){lne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lne(e,t,n){return t=une(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function une(e){var t=cne(e,"string");return Wh(t)=="symbol"?t:t+""}function cne(e,t){if(Wh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Wh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fne(e,t){if(e==null)return{};var n=hne(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function hne(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var g3={symbolCircle:dA,symbolCross:Ite,symbolDiamond:Rte,symbolSquare:Dte,symbolStar:Fte,symbolTriangle:zte,symbolWye:Ute},dne=Math.PI/180,pne=function(t){var n="symbol".concat(b0(t));return g3[n]||dA},mne=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*dne;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},gne=function(t,n){g3["symbol".concat(b0(t))]=n},pA=function(t){var n=t.type,r=n===void 0?"circle":n,i=t.size,o=i===void 0?64:i,s=t.sizeType,a=s===void 0?"area":s,l=fne(t,ane),u=W2(W2({},l),{},{type:r,size:o,sizeType:a}),c=function(){var v=pne(r),b=Hte().type(v).size(mne(o,a,r));return b()},f=u.className,h=u.cx,d=u.cy,p=pe(u,!0);return h===+h&&d===+d&&o===+o?L.createElement("path",sS({},p,{className:Se("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(d,")"),d:c()})):null};pA.registerSymbol=gne;function Uu(e){"@babel/helpers - typeof";return Uu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uu(e)}function aS(){return aS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},aS.apply(this,arguments)}function U2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yne(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?U2(Object(n),!0).forEach(function(r){Uh(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bne(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,v3(r.key),r)}}function xne(e,t,n){return t&&bne(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function wne(e,t,n){return t=Xg(t),Sne(e,y3()?Reflect.construct(t,n||[],Xg(e).constructor):t.apply(e,n))}function Sne(e,t){if(t&&(Uu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kne(e)}function kne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(y3=function(){return!!e})()}function Xg(e){return Xg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Xg(e)}function One(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lS(e,t)}function lS(e,t){return lS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},lS(e,t)}function Uh(e,t,n){return t=v3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v3(e){var t=Cne(e,"string");return Uu(t)=="symbol"?t:t+""}function Cne(e,t){if(Uu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Uu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Nr=32,mA=function(e){function t(){return vne(this,t),wne(this,t,arguments)}return One(t,e),xne(t,[{key:"renderIcon",value:function(r){var i=this.props.inactiveColor,o=Nr/2,s=Nr/6,a=Nr/3,l=r.inactive?i:r.color;if(r.type==="plainline")return L.createElement("line",{strokeWidth:4,fill:"none",stroke:l,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:o,x2:Nr,y2:o,className:"recharts-legend-icon"});if(r.type==="line")return L.createElement("path",{strokeWidth:4,fill:"none",stroke:l,d:"M0,".concat(o,"h").concat(a,`
|
|
294
|
-
A`).concat(s,",").concat(s,",0,1,1,").concat(2*a,",").concat(o,`
|
|
295
|
-
H`).concat(Nr,"M").concat(2*a,",").concat(o,`
|
|
296
|
-
A`).concat(s,",").concat(s,",0,1,1,").concat(a,",").concat(o),className:"recharts-legend-icon"});if(r.type==="rect")return L.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(Nr/8,"h").concat(Nr,"v").concat(Nr*3/4,"h").concat(-Nr,"z"),className:"recharts-legend-icon"});if(L.isValidElement(r.legendIcon)){var u=yne({},r);return delete u.legendIcon,L.cloneElement(r.legendIcon,u)}return L.createElement(pA,{fill:l,cx:o,cy:o,size:Nr,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,i=this.props,o=i.payload,s=i.iconSize,a=i.layout,l=i.formatter,u=i.inactiveColor,c={x:0,y:0,width:Nr,height:Nr},f={display:a==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return o.map(function(d,p){var m=d.formatter||l,v=Se(Uh(Uh({"recharts-legend-item":!0},"legend-item-".concat(p),!0),"inactive",d.inactive));if(d.type==="none")return null;var b=xe(d.value)?null:d.value;wo(!xe(d.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var y=d.inactive?u:d.color;return L.createElement("li",aS({className:v,style:f,key:"legend-item-".concat(p)},Za(r.props,d,p)),L.createElement(Zw,{width:s,height:s,viewBox:c,style:h},r.renderIcon(d)),L.createElement("span",{className:"recharts-legend-item-text",style:{color:y}},m?m(b,d,p):b))})}},{key:"render",value:function(){var r=this.props,i=r.payload,o=r.layout,s=r.align;if(!i||!i.length)return null;var a={padding:0,margin:0,textAlign:o==="horizontal"?s:"left"};return L.createElement("ul",{className:"recharts-default-legend",style:a},this.renderItems())}}])}(C.PureComponent);Uh(mA,"displayName","Legend");Uh(mA,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Ane=s0;function Pne(){this.__data__=new Ane,this.size=0}var Ene=Pne;function Tne(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var _ne=Tne;function jne(e){return this.__data__.get(e)}var Mne=jne;function Ine(e){return this.__data__.has(e)}var Nne=Ine,Rne=s0,Dne=nA,Lne=rA,$ne=200;function Bne(e,t){var n=this.__data__;if(n instanceof Rne){var r=n.__data__;if(!Dne||r.length<$ne-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Lne(r)}return n.set(e,t),this.size=n.size,this}var Fne=Bne,zne=s0,Wne=Ene,Une=_ne,Hne=Mne,Vne=Nne,qne=Fne;function Dc(e){var t=this.__data__=new zne(e);this.size=t.size}Dc.prototype.clear=Wne;Dc.prototype.delete=Une;Dc.prototype.get=Hne;Dc.prototype.has=Vne;Dc.prototype.set=qne;var b3=Dc,Kne="__lodash_hash_undefined__";function Gne(e){return this.__data__.set(e,Kne),this}var Qne=Gne;function Xne(e){return this.__data__.has(e)}var Yne=Xne,Zne=rA,Jne=Qne,ere=Yne;function Yg(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Zne;++t<n;)this.add(e[t])}Yg.prototype.add=Yg.prototype.push=Jne;Yg.prototype.has=ere;var x3=Yg;function tre(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var w3=tre;function nre(e,t){return e.has(t)}var S3=nre,rre=x3,ire=w3,ore=S3,sre=1,are=2;function lre(e,t,n,r,i,o){var s=n&sre,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var u=o.get(e),c=o.get(t);if(u&&c)return u==t&&c==e;var f=-1,h=!0,d=n&are?new rre:void 0;for(o.set(e,t),o.set(t,e);++f<a;){var p=e[f],m=t[f];if(r)var v=s?r(m,p,f,t,e,o):r(p,m,f,e,t,o);if(v!==void 0){if(v)continue;h=!1;break}if(d){if(!ire(t,function(b,y){if(!ore(d,y)&&(p===b||i(p,b,n,r,o)))return d.push(y)})){h=!1;break}}else if(!(p===m||i(p,m,n,r,o))){h=!1;break}}return o.delete(e),o.delete(t),h}var k3=lre,ure=Yi,cre=ure.Uint8Array,fre=cre;function hre(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var dre=hre;function pre(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var gA=pre,H2=Zd,V2=fre,mre=tA,gre=k3,yre=dre,vre=gA,bre=1,xre=2,wre="[object Boolean]",Sre="[object Date]",kre="[object Error]",Ore="[object Map]",Cre="[object Number]",Are="[object RegExp]",Pre="[object Set]",Ere="[object String]",Tre="[object Symbol]",_re="[object ArrayBuffer]",jre="[object DataView]",q2=H2?H2.prototype:void 0,vx=q2?q2.valueOf:void 0;function Mre(e,t,n,r,i,o,s){switch(n){case jre:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case _re:return!(e.byteLength!=t.byteLength||!o(new V2(e),new V2(t)));case wre:case Sre:case Cre:return mre(+e,+t);case kre:return e.name==t.name&&e.message==t.message;case Are:case Ere:return e==t+"";case Ore:var a=yre;case Pre:var l=r&bre;if(a||(a=vre),e.size!=t.size&&!l)return!1;var u=s.get(e);if(u)return u==t;r|=xre,s.set(e,t);var c=gre(a(e),a(t),r,i,o,s);return s.delete(e),c;case Tre:if(vx)return vx.call(e)==vx.call(t)}return!1}var Ire=Mre;function Nre(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var O3=Nre,Rre=O3,Dre=rr;function Lre(e,t,n){var r=t(e);return Dre(e)?r:Rre(r,n(e))}var $re=Lre;function Bre(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}var Fre=Bre;function zre(){return[]}var Wre=zre,Ure=Fre,Hre=Wre,Vre=Object.prototype,qre=Vre.propertyIsEnumerable,K2=Object.getOwnPropertySymbols,Kre=K2?function(e){return e==null?[]:(e=Object(e),Ure(K2(e),function(t){return qre.call(e,t)}))}:Hre,Gre=Kre;function Qre(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Xre=Qre,Yre=Bo,Zre=Fo,Jre="[object Arguments]";function eie(e){return Zre(e)&&Yre(e)==Jre}var tie=eie,G2=tie,nie=Fo,C3=Object.prototype,rie=C3.hasOwnProperty,iie=C3.propertyIsEnumerable,oie=G2(function(){return arguments}())?G2:function(e){return nie(e)&&rie.call(e,"callee")&&!iie.call(e,"callee")},yA=oie,Zg={exports:{}};function sie(){return!1}var aie=sie;Zg.exports;(function(e,t){var n=Yi,r=aie,i=t&&!t.nodeType&&t,o=i&&!0&&e&&!e.nodeType&&e,s=o&&o.exports===i,a=s?n.Buffer:void 0,l=a?a.isBuffer:void 0,u=l||r;e.exports=u})(Zg,Zg.exports);var A3=Zg.exports,lie=9007199254740991,uie=/^(?:0|[1-9]\d*)$/;function cie(e,t){var n=typeof e;return t=t??lie,!!t&&(n=="number"||n!="symbol"&&uie.test(e))&&e>-1&&e%1==0&&e<t}var vA=cie,fie=9007199254740991;function hie(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=fie}var bA=hie,die=Bo,pie=bA,mie=Fo,gie="[object Arguments]",yie="[object Array]",vie="[object Boolean]",bie="[object Date]",xie="[object Error]",wie="[object Function]",Sie="[object Map]",kie="[object Number]",Oie="[object Object]",Cie="[object RegExp]",Aie="[object Set]",Pie="[object String]",Eie="[object WeakMap]",Tie="[object ArrayBuffer]",_ie="[object DataView]",jie="[object Float32Array]",Mie="[object Float64Array]",Iie="[object Int8Array]",Nie="[object Int16Array]",Rie="[object Int32Array]",Die="[object Uint8Array]",Lie="[object Uint8ClampedArray]",$ie="[object Uint16Array]",Bie="[object Uint32Array]",ut={};ut[jie]=ut[Mie]=ut[Iie]=ut[Nie]=ut[Rie]=ut[Die]=ut[Lie]=ut[$ie]=ut[Bie]=!0;ut[gie]=ut[yie]=ut[Tie]=ut[vie]=ut[_ie]=ut[bie]=ut[xie]=ut[wie]=ut[Sie]=ut[kie]=ut[Oie]=ut[Cie]=ut[Aie]=ut[Pie]=ut[Eie]=!1;function Fie(e){return mie(e)&&pie(e.length)&&!!ut[die(e)]}var zie=Fie;function Wie(e){return function(t){return e(t)}}var P3=Wie,Jg={exports:{}};Jg.exports;(function(e,t){var n=RF,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===r,s=o&&n.process,a=function(){try{var l=i&&i.require&&i.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}}();e.exports=a})(Jg,Jg.exports);var Uie=Jg.exports,Hie=zie,Vie=P3,Q2=Uie,X2=Q2&&Q2.isTypedArray,qie=X2?Vie(X2):Hie,E3=qie,Kie=Xre,Gie=yA,Qie=rr,Xie=A3,Yie=vA,Zie=E3,Jie=Object.prototype,eoe=Jie.hasOwnProperty;function toe(e,t){var n=Qie(e),r=!n&&Gie(e),i=!n&&!r&&Xie(e),o=!n&&!r&&!i&&Zie(e),s=n||r||i||o,a=s?Kie(e.length,String):[],l=a.length;for(var u in e)(t||eoe.call(e,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Yie(u,l)))&&a.push(u);return a}var noe=toe,roe=Object.prototype;function ioe(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||roe;return e===n}var ooe=ioe;function soe(e,t){return function(n){return e(t(n))}}var T3=soe,aoe=T3,loe=aoe(Object.keys,Object),uoe=loe,coe=ooe,foe=uoe,hoe=Object.prototype,doe=hoe.hasOwnProperty;function poe(e){if(!coe(e))return foe(e);var t=[];for(var n in Object(e))doe.call(e,n)&&n!="constructor"&&t.push(n);return t}var moe=poe,goe=eA,yoe=bA;function voe(e){return e!=null&&yoe(e.length)&&!goe(e)}var k0=voe,boe=noe,xoe=moe,woe=k0;function Soe(e){return woe(e)?boe(e):xoe(e)}var xA=Soe,koe=$re,Ooe=Gre,Coe=xA;function Aoe(e){return koe(e,Coe,Ooe)}var Poe=Aoe,Y2=Poe,Eoe=1,Toe=Object.prototype,_oe=Toe.hasOwnProperty;function joe(e,t,n,r,i,o){var s=n&Eoe,a=Y2(e),l=a.length,u=Y2(t),c=u.length;if(l!=c&&!s)return!1;for(var f=l;f--;){var h=a[f];if(!(s?h in t:_oe.call(t,h)))return!1}var d=o.get(e),p=o.get(t);if(d&&p)return d==t&&p==e;var m=!0;o.set(e,t),o.set(t,e);for(var v=s;++f<l;){h=a[f];var b=e[h],y=t[h];if(r)var x=s?r(y,b,h,t,e,o):r(b,y,h,e,t,o);if(!(x===void 0?b===y||i(b,y,n,r,o):x)){m=!1;break}v||(v=h=="constructor")}if(m&&!v){var k=e.constructor,w=t.constructor;k!=w&&"constructor"in e&&"constructor"in t&&!(typeof k=="function"&&k instanceof k&&typeof w=="function"&&w instanceof w)&&(m=!1)}return o.delete(e),o.delete(t),m}var Moe=joe,Ioe=hl,Noe=Yi,Roe=Ioe(Noe,"DataView"),Doe=Roe,Loe=hl,$oe=Yi,Boe=Loe($oe,"Promise"),Foe=Boe,zoe=hl,Woe=Yi,Uoe=zoe(Woe,"Set"),_3=Uoe,Hoe=hl,Voe=Yi,qoe=Hoe(Voe,"WeakMap"),Koe=qoe,uS=Doe,cS=nA,fS=Foe,hS=_3,dS=Koe,j3=Bo,Lc=LF,Z2="[object Map]",Goe="[object Object]",J2="[object Promise]",e_="[object Set]",t_="[object WeakMap]",n_="[object DataView]",Qoe=Lc(uS),Xoe=Lc(cS),Yoe=Lc(fS),Zoe=Lc(hS),Joe=Lc(dS),ua=j3;(uS&&ua(new uS(new ArrayBuffer(1)))!=n_||cS&&ua(new cS)!=Z2||fS&&ua(fS.resolve())!=J2||hS&&ua(new hS)!=e_||dS&&ua(new dS)!=t_)&&(ua=function(e){var t=j3(e),n=t==Goe?e.constructor:void 0,r=n?Lc(n):"";if(r)switch(r){case Qoe:return n_;case Xoe:return Z2;case Yoe:return J2;case Zoe:return e_;case Joe:return t_}return t});var ese=ua,bx=b3,tse=k3,nse=Ire,rse=Moe,r_=ese,i_=rr,o_=A3,ise=E3,ose=1,s_="[object Arguments]",a_="[object Array]",Hp="[object Object]",sse=Object.prototype,l_=sse.hasOwnProperty;function ase(e,t,n,r,i,o){var s=i_(e),a=i_(t),l=s?a_:r_(e),u=a?a_:r_(t);l=l==s_?Hp:l,u=u==s_?Hp:u;var c=l==Hp,f=u==Hp,h=l==u;if(h&&o_(e)){if(!o_(t))return!1;s=!0,c=!1}if(h&&!c)return o||(o=new bx),s||ise(e)?tse(e,t,n,r,i,o):nse(e,t,l,n,r,i,o);if(!(n&ose)){var d=c&&l_.call(e,"__wrapped__"),p=f&&l_.call(t,"__wrapped__");if(d||p){var m=d?e.value():e,v=p?t.value():t;return o||(o=new bx),i(m,v,n,r,o)}}return h?(o||(o=new bx),rse(e,t,n,r,i,o)):!1}var lse=ase,use=lse,u_=Fo;function M3(e,t,n,r,i){return e===t?!0:e==null||t==null||!u_(e)&&!u_(t)?e!==e&&t!==t:use(e,t,n,r,M3,i)}var wA=M3,cse=b3,fse=wA,hse=1,dse=2;function pse(e,t,n,r){var i=n.length,o=i,s=!r;if(e==null)return!o;for(e=Object(e);i--;){var a=n[i];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){a=n[i];var l=a[0],u=e[l],c=a[1];if(s&&a[2]){if(u===void 0&&!(l in e))return!1}else{var f=new cse;if(r)var h=r(u,c,l,e,t,f);if(!(h===void 0?fse(c,u,hse|dse,r,f):h))return!1}}return!0}var mse=pse,gse=Ws;function yse(e){return e===e&&!gse(e)}var I3=yse,vse=I3,bse=xA;function xse(e){for(var t=bse(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,vse(i)]}return t}var wse=xse;function Sse(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var N3=Sse,kse=mse,Ose=wse,Cse=N3;function Ase(e){var t=Ose(e);return t.length==1&&t[0][2]?Cse(t[0][0],t[0][1]):function(n){return n===e||kse(n,e,t)}}var Pse=Ase;function Ese(e,t){return e!=null&&t in Object(e)}var Tse=Ese,_se=WF,jse=yA,Mse=rr,Ise=vA,Nse=bA,Rse=l0;function Dse(e,t,n){t=_se(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var s=Rse(t[r]);if(!(o=e!=null&&n(e,s)))break;e=e[s]}return o||++r!=i?o:(i=e==null?0:e.length,!!i&&Nse(i)&&Ise(s,i)&&(Mse(e)||jse(e)))}var Lse=Dse,$se=Tse,Bse=Lse;function Fse(e,t){return e!=null&&Bse(e,t,$se)}var zse=Fse,Wse=wA,Use=UF,Hse=zse,Vse=JC,qse=I3,Kse=N3,Gse=l0,Qse=1,Xse=2;function Yse(e,t){return Vse(e)&&qse(t)?Kse(Gse(e),t):function(n){var r=Use(n,e);return r===void 0&&r===t?Hse(n,e):Wse(t,r,Qse|Xse)}}var Zse=Yse;function Jse(e){return e}var $c=Jse;function eae(e){return function(t){return t?.[e]}}var tae=eae,nae=sA;function rae(e){return function(t){return nae(t,e)}}var iae=rae,oae=tae,sae=iae,aae=JC,lae=l0;function uae(e){return aae(e)?oae(lae(e)):sae(e)}var cae=uae,fae=Pse,hae=Zse,dae=$c,pae=rr,mae=cae;function gae(e){return typeof e=="function"?e:e==null?dae:typeof e=="object"?pae(e)?hae(e[0],e[1]):fae(e):mae(e)}var Us=gae;function yae(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}var vae=yae;function bae(e){return e!==e}var xae=bae;function wae(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var Sae=wae,kae=vae,Oae=xae,Cae=Sae;function Aae(e,t,n){return t===t?Cae(e,t,n):kae(e,Oae,n)}var Pae=Aae,Eae=Pae;function Tae(e,t){var n=e==null?0:e.length;return!!n&&Eae(e,t,0)>-1}var _ae=Tae;function jae(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var Mae=jae;function Iae(){}var Nae=Iae,xx=_3,Rae=Nae,Dae=gA,Lae=1/0,$ae=xx&&1/Dae(new xx([,-0]))[1]==Lae?function(e){return new xx(e)}:Rae,Bae=$ae,Fae=x3,zae=_ae,Wae=Mae,Uae=S3,Hae=Bae,Vae=gA,qae=200;function Kae(e,t,n){var r=-1,i=zae,o=e.length,s=!0,a=[],l=a;if(n)s=!1,i=Wae;else if(o>=qae){var u=t?null:Hae(e);if(u)return Vae(u);s=!1,i=Uae,l=new Fae}else l=t?[]:a;e:for(;++r<o;){var c=e[r],f=t?t(c):c;if(c=n||c!==0?c:0,s&&f===f){for(var h=l.length;h--;)if(l[h]===f)continue e;t&&l.push(f),a.push(c)}else i(l,f,n)||(l!==a&&l.push(f),a.push(c))}return a}var Gae=Kae,Qae=Us,Xae=Gae;function Yae(e,t){return e&&e.length?Xae(e,Qae(t)):[]}var Zae=Yae;const c_=ze(Zae);function R3(e,t,n){return t===!0?c_(e,n):xe(t)?c_(e,t):e}function Hu(e){"@babel/helpers - typeof";return Hu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hu(e)}var Jae=["ref"];function f_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ro(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f_(Object(n),!0).forEach(function(r){O0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ele(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,L3(r.key),r)}}function tle(e,t,n){return t&&h_(e.prototype,t),n&&h_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function nle(e,t,n){return t=ey(t),rle(e,D3()?Reflect.construct(t,n||[],ey(e).constructor):t.apply(e,n))}function rle(e,t){if(t&&(Hu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ile(e)}function ile(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function D3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(D3=function(){return!!e})()}function ey(e){return ey=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ey(e)}function ole(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pS(e,t)}function pS(e,t){return pS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},pS(e,t)}function O0(e,t,n){return t=L3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L3(e){var t=sle(e,"string");return Hu(t)=="symbol"?t:t+""}function sle(e,t){if(Hu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Hu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function ale(e,t){if(e==null)return{};var n=lle(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function lle(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ule(e){return e.value}function cle(e,t){if(L.isValidElement(e))return L.cloneElement(e,t);if(typeof e=="function")return L.createElement(e,t);t.ref;var n=ale(t,Jae);return L.createElement(mA,n)}var d_=1,xu=function(e){function t(){var n;ele(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=nle(this,t,[].concat(i)),O0(n,"lastBoundingBox",{width:-1,height:-1}),n}return ole(t,e),tle(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,i=this.getBBox();i?(Math.abs(i.width-this.lastBoundingBox.width)>d_||Math.abs(i.height-this.lastBoundingBox.height)>d_)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?ro({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,o=i.layout,s=i.align,a=i.verticalAlign,l=i.margin,u=i.chartWidth,c=i.chartHeight,f,h;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(s==="center"&&o==="vertical"){var d=this.getBBoxSnapshot();f={left:((u||0)-d.width)/2}}else f=s==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(a==="middle"){var p=this.getBBoxSnapshot();h={top:((c||0)-p.height)/2}}else h=a==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return ro(ro({},f),h)}},{key:"render",value:function(){var r=this,i=this.props,o=i.content,s=i.width,a=i.height,l=i.wrapperStyle,u=i.payloadUniqBy,c=i.payload,f=ro(ro({position:"absolute",width:s||"auto",height:a||"auto"},this.getDefaultPosition(l)),l);return L.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(d){r.wrapperNode=d}},cle(o,ro(ro({},this.props),{},{payload:R3(c,u,ule)})))}}],[{key:"getWithHeight",value:function(r,i){var o=ro(ro({},this.defaultProps),r.props),s=o.layout;return s==="vertical"&&ne(r.props.height)?{height:r.props.height}:s==="horizontal"?{width:r.props.width||i}:null}}])}(C.PureComponent);O0(xu,"displayName","Legend");O0(xu,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var p_=Zd,fle=yA,hle=rr,m_=p_?p_.isConcatSpreadable:void 0;function dle(e){return hle(e)||fle(e)||!!(m_&&e&&e[m_])}var ple=dle,mle=O3,gle=ple;function $3(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=gle),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?$3(a,t-1,n,r,i):mle(i,a):r||(i[i.length]=a)}return i}var B3=$3;function yle(e){return function(t,n,r){for(var i=-1,o=Object(t),s=r(t),a=s.length;a--;){var l=s[e?a:++i];if(n(o[l],l,o)===!1)break}return t}}var vle=yle,ble=vle,xle=ble(),wle=xle,Sle=wle,kle=xA;function Ole(e,t){return e&&Sle(e,t,kle)}var F3=Ole,Cle=k0;function Ale(e,t){return function(n,r){if(n==null)return n;if(!Cle(n))return e(n,r);for(var i=n.length,o=t?i:-1,s=Object(n);(t?o--:++o<i)&&r(s[o],o,s)!==!1;);return n}}var Ple=Ale,Ele=F3,Tle=Ple,_le=Tle(Ele),SA=_le,jle=SA,Mle=k0;function Ile(e,t){var n=-1,r=Mle(e)?Array(e.length):[];return jle(e,function(i,o,s){r[++n]=t(i,o,s)}),r}var z3=Ile;function Nle(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var Rle=Nle,g_=_c;function Dle(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,o=g_(e),s=t!==void 0,a=t===null,l=t===t,u=g_(t);if(!a&&!u&&!o&&e>t||o&&s&&l&&!a&&!u||r&&s&&l||!n&&l||!i)return 1;if(!r&&!o&&!u&&e<t||u&&n&&i&&!r&&!o||a&&n&&i||!s&&i||!l)return-1}return 0}var Lle=Dle,$le=Lle;function Ble(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,s=i.length,a=n.length;++r<s;){var l=$le(i[r],o[r]);if(l){if(r>=a)return l;var u=n[r];return l*(u=="desc"?-1:1)}}return e.index-t.index}var Fle=Ble,wx=oA,zle=sA,Wle=Us,Ule=z3,Hle=Rle,Vle=P3,qle=Fle,Kle=$c,Gle=rr;function Qle(e,t,n){t.length?t=wx(t,function(o){return Gle(o)?function(s){return zle(s,o.length===1?o[0]:o)}:o}):t=[Kle];var r=-1;t=wx(t,Vle(Wle));var i=Ule(e,function(o,s,a){var l=wx(t,function(u){return u(o)});return{criteria:l,index:++r,value:o}});return Hle(i,function(o,s){return qle(o,s,n)})}var Xle=Qle;function Yle(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var Zle=Yle,Jle=Zle,y_=Math.max;function eue(e,t,n){return t=y_(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=y_(r.length-t,0),s=Array(o);++i<o;)s[i]=r[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=r[i];return a[t]=n(s),Jle(e,this,a)}}var tue=eue;function nue(e){return function(){return e}}var rue=nue,iue=hl,oue=function(){try{var e=iue(Object,"defineProperty");return e({},"",{}),e}catch{}}(),W3=oue,sue=rue,v_=W3,aue=$c,lue=v_?function(e,t){return v_(e,"toString",{configurable:!0,enumerable:!1,value:sue(t),writable:!0})}:aue,uue=lue,cue=800,fue=16,hue=Date.now;function due(e){var t=0,n=0;return function(){var r=hue(),i=fue-(r-n);if(n=r,i>0){if(++t>=cue)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var pue=due,mue=uue,gue=pue,yue=gue(mue),vue=yue,bue=$c,xue=tue,wue=vue;function Sue(e,t){return wue(xue(e,t,bue),e+"")}var kue=Sue,Oue=tA,Cue=k0,Aue=vA,Pue=Ws;function Eue(e,t,n){if(!Pue(n))return!1;var r=typeof t;return(r=="number"?Cue(n)&&Aue(t,n.length):r=="string"&&t in n)?Oue(n[t],e):!1}var C0=Eue,Tue=B3,_ue=Xle,jue=kue,b_=C0,Mue=jue(function(e,t){if(e==null)return[];var n=t.length;return n>1&&b_(e,t[0],t[1])?t=[]:n>2&&b_(t[0],t[1],t[2])&&(t=[t[0]]),_ue(e,Tue(t,1),[])}),Iue=Mue;const kA=ze(Iue);function Hh(e){"@babel/helpers - typeof";return Hh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hh(e)}function mS(){return mS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mS.apply(this,arguments)}function Nue(e,t){return $ue(e)||Lue(e,t)||Due(e,t)||Rue()}function Rue(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
297
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Due(e,t){if(e){if(typeof e=="string")return x_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x_(e,t)}}function x_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Lue(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function $ue(e){if(Array.isArray(e))return e}function w_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?w_(Object(n),!0).forEach(function(r){Bue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bue(e,t,n){return t=Fue(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fue(e){var t=zue(e,"string");return Hh(t)=="symbol"?t:t+""}function zue(e,t){if(Hh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Hh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wue(e){return Array.isArray(e)&&qt(e[0])&&qt(e[1])?e.join(" ~ "):e}var Uue=function(t){var n=t.separator,r=n===void 0?" : ":n,i=t.contentStyle,o=i===void 0?{}:i,s=t.itemStyle,a=s===void 0?{}:s,l=t.labelStyle,u=l===void 0?{}:l,c=t.payload,f=t.formatter,h=t.itemSorter,d=t.wrapperClassName,p=t.labelClassName,m=t.label,v=t.labelFormatter,b=t.accessibilityLayer,y=b===void 0?!1:b,x=function(){if(c&&c.length){var E={padding:0,margin:0},D=(h?kA(c,h):c).map(function(R,N){if(R.type==="none")return null;var B=Sx({display:"block",paddingTop:4,paddingBottom:4,color:R.color||"#000"},a),F=R.formatter||f||Wue,$=R.value,z=R.name,T=$,q=z;if(F&&T!=null&&q!=null){var I=F($,z,R,N,c);if(Array.isArray(I)){var _=Nue(I,2);T=_[0],q=_[1]}else T=I}return L.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(N),style:B},qt(q)?L.createElement("span",{className:"recharts-tooltip-item-name"},q):null,qt(q)?L.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,L.createElement("span",{className:"recharts-tooltip-item-value"},T),L.createElement("span",{className:"recharts-tooltip-item-unit"},R.unit||""))});return L.createElement("ul",{className:"recharts-tooltip-item-list",style:E},D)}return null},k=Sx({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},o),w=Sx({margin:0},u),S=!we(m),O=S?m:"",A=Se("recharts-default-tooltip",d),P=Se("recharts-tooltip-label",p);S&&v&&c!==void 0&&c!==null&&(O=v(m,c));var M=y?{role:"status","aria-live":"assertive"}:{};return L.createElement("div",mS({className:A,style:k},M),L.createElement("p",{className:P,style:w},L.isValidElement(O)?O:"".concat(O)),x())};function Vh(e){"@babel/helpers - typeof";return Vh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vh(e)}function Vp(e,t,n){return t=Hue(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hue(e){var t=Vue(e,"string");return Vh(t)=="symbol"?t:t+""}function Vue(e,t){if(Vh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hf="recharts-tooltip-wrapper",que={visibility:"hidden"};function Kue(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Se(hf,Vp(Vp(Vp(Vp({},"".concat(hf,"-right"),ne(n)&&t&&ne(t.x)&&n>=t.x),"".concat(hf,"-left"),ne(n)&&t&&ne(t.x)&&n<t.x),"".concat(hf,"-bottom"),ne(r)&&t&&ne(t.y)&&r>=t.y),"".concat(hf,"-top"),ne(r)&&t&&ne(t.y)&&r<t.y))}function S_(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,i=e.offsetTopLeft,o=e.position,s=e.reverseDirection,a=e.tooltipDimension,l=e.viewBox,u=e.viewBoxDimension;if(o&&ne(o[r]))return o[r];var c=n[r]-a-i,f=n[r]+i;if(t[r])return s[r]?c:f;if(s[r]){var h=c,d=l[r];return h<d?Math.max(f,l[r]):Math.max(c,l[r])}var p=f+a,m=l[r]+u;return p>m?Math.max(c,l[r]):Math.max(f,l[r])}function Gue(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function Que(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,i=e.position,o=e.reverseDirection,s=e.tooltipBox,a=e.useTranslate3d,l=e.viewBox,u,c,f;return s.height>0&&s.width>0&&n?(c=S_({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:s.width,viewBox:l,viewBoxDimension:l.width}),f=S_({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:s.height,viewBox:l,viewBoxDimension:l.height}),u=Gue({translateX:c,translateY:f,useTranslate3d:a})):u=que,{cssProperties:u,cssClasses:Kue({translateX:c,translateY:f,coordinate:n})}}function Vu(e){"@babel/helpers - typeof";return Vu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vu(e)}function k_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function O_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?k_(Object(n),!0).forEach(function(r){yS(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yue(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,H3(r.key),r)}}function Zue(e,t,n){return t&&Yue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Jue(e,t,n){return t=ty(t),ece(e,U3()?Reflect.construct(t,n||[],ty(e).constructor):t.apply(e,n))}function ece(e,t){if(t&&(Vu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tce(e)}function tce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function U3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(U3=function(){return!!e})()}function ty(e){return ty=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ty(e)}function nce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gS(e,t)}function gS(e,t){return gS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},gS(e,t)}function yS(e,t,n){return t=H3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H3(e){var t=rce(e,"string");return Vu(t)=="symbol"?t:t+""}function rce(e,t){if(Vu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var C_=1,ice=function(e){function t(){var n;Xue(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=Jue(this,t,[].concat(i)),yS(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),yS(n,"handleKeyDown",function(s){if(s.key==="Escape"){var a,l,u,c;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(a=(l=n.props.coordinate)===null||l===void 0?void 0:l.x)!==null&&a!==void 0?a:0,y:(u=(c=n.props.coordinate)===null||c===void 0?void 0:c.y)!==null&&u!==void 0?u:0}})}}),n}return nce(t,e),Zue(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>C_||Math.abs(r.height-this.state.lastBoundingBox.height)>C_)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,o=i.active,s=i.allowEscapeViewBox,a=i.animationDuration,l=i.animationEasing,u=i.children,c=i.coordinate,f=i.hasPayload,h=i.isAnimationActive,d=i.offset,p=i.position,m=i.reverseDirection,v=i.useTranslate3d,b=i.viewBox,y=i.wrapperStyle,x=Que({allowEscapeViewBox:s,coordinate:c,offsetTopLeft:d,position:p,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:v,viewBox:b}),k=x.cssClasses,w=x.cssProperties,S=O_(O_({transition:h&&o?"transform ".concat(a,"ms ").concat(l):void 0},w),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&f?"visible":"hidden",position:"absolute",top:0,left:0},y);return L.createElement("div",{tabIndex:-1,className:k,style:S,ref:function(A){r.wrapperNode=A}},u)}}])}(C.PureComponent),oce=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},dl={isSsr:oce()};function qu(e){"@babel/helpers - typeof";return qu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qu(e)}function A_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function P_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?A_(Object(n),!0).forEach(function(r){OA(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ace(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,q3(r.key),r)}}function lce(e,t,n){return t&&ace(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function uce(e,t,n){return t=ny(t),cce(e,V3()?Reflect.construct(t,n||[],ny(e).constructor):t.apply(e,n))}function cce(e,t){if(t&&(qu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fce(e)}function fce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function V3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(V3=function(){return!!e})()}function ny(e){return ny=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ny(e)}function hce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vS(e,t)}function vS(e,t){return vS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},vS(e,t)}function OA(e,t,n){return t=q3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function q3(e){var t=dce(e,"string");return qu(t)=="symbol"?t:t+""}function dce(e,t){if(qu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(qu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function pce(e){return e.dataKey}function mce(e,t){return L.isValidElement(e)?L.cloneElement(e,t):typeof e=="function"?L.createElement(e,t):L.createElement(Uue,t)}var oi=function(e){function t(){return sce(this,t),uce(this,t,arguments)}return hce(t,e),lce(t,[{key:"render",value:function(){var r=this,i=this.props,o=i.active,s=i.allowEscapeViewBox,a=i.animationDuration,l=i.animationEasing,u=i.content,c=i.coordinate,f=i.filterNull,h=i.isAnimationActive,d=i.offset,p=i.payload,m=i.payloadUniqBy,v=i.position,b=i.reverseDirection,y=i.useTranslate3d,x=i.viewBox,k=i.wrapperStyle,w=p??[];f&&w.length&&(w=R3(p.filter(function(O){return O.value!=null&&(O.hide!==!0||r.props.includeHidden)}),m,pce));var S=w.length>0;return L.createElement(ice,{allowEscapeViewBox:s,animationDuration:a,animationEasing:l,isAnimationActive:h,active:o,coordinate:c,hasPayload:S,offset:d,position:v,reverseDirection:b,useTranslate3d:y,viewBox:x,wrapperStyle:k},mce(u,P_(P_({},this.props),{},{payload:w})))}}])}(C.PureComponent);OA(oi,"displayName","Tooltip");OA(oi,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!dl.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var gce=Yi,yce=function(){return gce.Date.now()},vce=yce,bce=/\s/;function xce(e){for(var t=e.length;t--&&bce.test(e.charAt(t)););return t}var wce=xce,Sce=wce,kce=/^\s+/;function Oce(e){return e&&e.slice(0,Sce(e)+1).replace(kce,"")}var Cce=Oce,Ace=Cce,E_=Ws,Pce=_c,T_=NaN,Ece=/^[-+]0x[0-9a-f]+$/i,Tce=/^0b[01]+$/i,_ce=/^0o[0-7]+$/i,jce=parseInt;function Mce(e){if(typeof e=="number")return e;if(Pce(e))return T_;if(E_(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=E_(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Ace(e);var n=Tce.test(e);return n||_ce.test(e)?jce(e.slice(2),n?2:8):Ece.test(e)?T_:+e}var K3=Mce,Ice=Ws,kx=vce,__=K3,Nce="Expected a function",Rce=Math.max,Dce=Math.min;function Lce(e,t,n){var r,i,o,s,a,l,u=0,c=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError(Nce);t=__(t)||0,Ice(n)&&(c=!!n.leading,f="maxWait"in n,o=f?Rce(__(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h);function d(S){var O=r,A=i;return r=i=void 0,u=S,s=e.apply(A,O),s}function p(S){return u=S,a=setTimeout(b,t),c?d(S):s}function m(S){var O=S-l,A=S-u,P=t-O;return f?Dce(P,o-A):P}function v(S){var O=S-l,A=S-u;return l===void 0||O>=t||O<0||f&&A>=o}function b(){var S=kx();if(v(S))return y(S);a=setTimeout(b,m(S))}function y(S){return a=void 0,h&&r?d(S):(r=i=void 0,s)}function x(){a!==void 0&&clearTimeout(a),u=0,r=l=i=a=void 0}function k(){return a===void 0?s:y(kx())}function w(){var S=kx(),O=v(S);if(r=arguments,i=this,l=S,O){if(a===void 0)return p(l);if(f)return clearTimeout(a),a=setTimeout(b,t),d(l)}return a===void 0&&(a=setTimeout(b,t)),s}return w.cancel=x,w.flush=k,w}var $ce=Lce,Bce=$ce,Fce=Ws,zce="Expected a function";function Wce(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(zce);return Fce(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Bce(e,t,{leading:r,maxWait:t,trailing:i})}var Uce=Wce;const G3=ze(Uce);function qh(e){"@babel/helpers - typeof";return qh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qh(e)}function j_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function qp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?j_(Object(n),!0).forEach(function(r){Hce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hce(e,t,n){return t=Vce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vce(e){var t=qce(e,"string");return qh(t)=="symbol"?t:t+""}function qce(e,t){if(qh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(qh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Kce(e,t){return Yce(e)||Xce(e,t)||Qce(e,t)||Gce()}function Gce(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
298
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qce(e,t){if(e){if(typeof e=="string")return M_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return M_(e,t)}}function M_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Xce(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function Yce(e){if(Array.isArray(e))return e}var Q3=C.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,i=r===void 0?{width:-1,height:-1}:r,o=e.width,s=o===void 0?"100%":o,a=e.height,l=a===void 0?"100%":a,u=e.minWidth,c=u===void 0?0:u,f=e.minHeight,h=e.maxHeight,d=e.children,p=e.debounce,m=p===void 0?0:p,v=e.id,b=e.className,y=e.onResize,x=e.style,k=x===void 0?{}:x,w=C.useRef(null),S=C.useRef();S.current=y,C.useImperativeHandle(t,function(){return Object.defineProperty(w.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),w.current},configurable:!0})});var O=C.useState({containerWidth:i.width,containerHeight:i.height}),A=Kce(O,2),P=A[0],M=A[1],j=C.useCallback(function(D,R){M(function(N){var B=Math.round(D),F=Math.round(R);return N.containerWidth===B&&N.containerHeight===F?N:{containerWidth:B,containerHeight:F}})},[]);C.useEffect(function(){var D=function(z){var T,q=z[0].contentRect,I=q.width,_=q.height;j(I,_),(T=S.current)===null||T===void 0||T.call(S,I,_)};m>0&&(D=G3(D,m,{trailing:!0,leading:!1}));var R=new ResizeObserver(D),N=w.current.getBoundingClientRect(),B=N.width,F=N.height;return j(B,F),R.observe(w.current),function(){R.disconnect()}},[j,m]);var E=C.useMemo(function(){var D=P.containerWidth,R=P.containerHeight;if(D<0||R<0)return null;wo(Sa(s)||Sa(l),`The width(%s) and height(%s) are both fixed numbers,
|
|
299
|
-
maybe you don't need to use a ResponsiveContainer.`,s,l),wo(!n||n>0,"The aspect(%s) must be greater than zero.",n);var N=Sa(s)?D:s,B=Sa(l)?R:l;n&&n>0&&(N?B=N/n:B&&(N=B*n),h&&B>h&&(B=h)),wo(N>0||B>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
300
|
-
please check the style of container, or the props width(%s) and height(%s),
|
|
301
|
-
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
302
|
-
height and width.`,N,B,s,l,c,f,n);var F=!Array.isArray(d)&&xo(d.type).endsWith("Chart");return L.Children.map(d,function($){return L.isValidElement($)?C.cloneElement($,qp({width:N,height:B},F?{style:qp({height:"100%",width:"100%",maxHeight:B,maxWidth:N},$.props.style)}:{})):$})},[n,d,l,h,f,c,P,s]);return L.createElement("div",{id:v?"".concat(v):void 0,className:Se("recharts-responsive-container",b),style:qp(qp({},k),{},{width:s,height:l,minWidth:c,minHeight:f,maxHeight:h}),ref:w},E)}),Ku=function(t){return null};Ku.displayName="Cell";function Kh(e){"@babel/helpers - typeof";return Kh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kh(e)}function I_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function bS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?I_(Object(n),!0).forEach(function(r){Zce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Zce(e,t,n){return t=Jce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jce(e){var t=efe(e,"string");return Kh(t)=="symbol"?t:t+""}function efe(e,t){if(Kh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Kh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Al={widthCache:{},cacheCount:0},tfe=2e3,nfe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},N_="recharts_measurement_span";function rfe(e){var t=bS({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var Yf=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||dl.isSsr)return{width:0,height:0};var r=rfe(n),i=JSON.stringify({text:t,copyStyle:r});if(Al.widthCache[i])return Al.widthCache[i];try{var o=document.getElementById(N_);o||(o=document.createElement("span"),o.setAttribute("id",N_),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var s=bS(bS({},nfe),r);Object.assign(o.style,s),o.textContent="".concat(t);var a=o.getBoundingClientRect(),l={width:a.width,height:a.height};return Al.widthCache[i]=l,++Al.cacheCount>tfe&&(Al.cacheCount=0,Al.widthCache={}),l}catch{return{width:0,height:0}}},ife=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Gh(e){"@babel/helpers - typeof";return Gh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gh(e)}function ry(e,t){return lfe(e)||afe(e,t)||sfe(e,t)||ofe()}function ofe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
303
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sfe(e,t){if(e){if(typeof e=="string")return R_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return R_(e,t)}}function R_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function afe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function lfe(e){if(Array.isArray(e))return e}function ufe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function D_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ffe(r.key),r)}}function cfe(e,t,n){return t&&D_(e.prototype,t),n&&D_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ffe(e){var t=hfe(e,"string");return Gh(t)=="symbol"?t:t+""}function hfe(e,t){if(Gh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Gh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var L_=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,$_=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,dfe=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,pfe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,X3={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},mfe=Object.keys(X3),eu="NaN";function gfe(e,t){return e*X3[t]}var Kp=function(){function e(t,n){ufe(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!dfe.test(n)&&(this.num=NaN,this.unit=""),mfe.includes(n)&&(this.num=gfe(t,n),this.unit="px")}return cfe(e,[{key:"add",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var r,i=(r=pfe.exec(n))!==null&&r!==void 0?r:[],o=ry(i,3),s=o[1],a=o[2];return new e(parseFloat(s),a??"")}}])}();function Y3(e){if(e.includes(eu))return eu;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=L_.exec(t))!==null&&n!==void 0?n:[],i=ry(r,4),o=i[1],s=i[2],a=i[3],l=Kp.parse(o??""),u=Kp.parse(a??""),c=s==="*"?l.multiply(u):l.divide(u);if(c.isNaN())return eu;t=t.replace(L_,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,h=(f=$_.exec(t))!==null&&f!==void 0?f:[],d=ry(h,4),p=d[1],m=d[2],v=d[3],b=Kp.parse(p??""),y=Kp.parse(v??""),x=m==="+"?b.add(y):b.subtract(y);if(x.isNaN())return eu;t=t.replace($_,x.toString())}return t}var B_=/\(([^()]*)\)/;function yfe(e){for(var t=e;t.includes("(");){var n=B_.exec(t),r=ry(n,2),i=r[1];t=t.replace(B_,Y3(i))}return t}function vfe(e){var t=e.replace(/\s+/g,"");return t=yfe(t),t=Y3(t),t}function bfe(e){try{return vfe(e)}catch{return eu}}function Ox(e){var t=bfe(e.slice(5,-1));return t===eu?"":t}var xfe=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],wfe=["dx","dy","angle","className","breakAll"];function xS(){return xS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xS.apply(this,arguments)}function F_(e,t){if(e==null)return{};var n=Sfe(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Sfe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function z_(e,t){return Afe(e)||Cfe(e,t)||Ofe(e,t)||kfe()}function kfe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
304
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ofe(e,t){if(e){if(typeof e=="string")return W_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return W_(e,t)}}function W_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Cfe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function Afe(e){if(Array.isArray(e))return e}var Z3=/[ \f\n\r\t\v\u2028\u2029]+/,J3=function(t){var n=t.children,r=t.breakAll,i=t.style;try{var o=[];we(n)||(r?o=n.toString().split(""):o=n.toString().split(Z3));var s=o.map(function(l){return{word:l,width:Yf(l,i).width}}),a=r?0:Yf(" ",i).width;return{wordsWithComputedWidth:s,spaceWidth:a}}catch{return null}},Pfe=function(t,n,r,i,o){var s=t.maxLines,a=t.children,l=t.style,u=t.breakAll,c=ne(s),f=a,h=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return N.reduce(function(B,F){var $=F.word,z=F.width,T=B[B.length-1];if(T&&(i==null||o||T.width+z+r<Number(i)))T.words.push($),T.width+=z+r;else{var q={words:[$],width:z};B.push(q)}return B},[])},d=h(n),p=function(N){return N.reduce(function(B,F){return B.width>F.width?B:F})};if(!c)return d;for(var m="…",v=function(N){var B=f.slice(0,N),F=J3({breakAll:u,style:l,children:B+m}).wordsWithComputedWidth,$=h(F),z=$.length>s||p($).width>Number(i);return[z,$]},b=0,y=f.length-1,x=0,k;b<=y&&x<=f.length-1;){var w=Math.floor((b+y)/2),S=w-1,O=v(S),A=z_(O,2),P=A[0],M=A[1],j=v(w),E=z_(j,1),D=E[0];if(!P&&!D&&(b=w+1),P&&D&&(y=w-1),!P&&D){k=M;break}x++}return k||d},U_=function(t){var n=we(t)?[]:t.toString().split(Z3);return[{words:n}]},Efe=function(t){var n=t.width,r=t.scaleToFit,i=t.children,o=t.style,s=t.breakAll,a=t.maxLines;if((n||r)&&!dl.isSsr){var l,u,c=J3({breakAll:s,children:i,style:o});if(c){var f=c.wordsWithComputedWidth,h=c.spaceWidth;l=f,u=h}else return U_(i);return Pfe({breakAll:s,children:i,maxLines:a,style:o},l,u,n,r)}return U_(i)},H_="#808080",Ja=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,o=i===void 0?0:i,s=t.lineHeight,a=s===void 0?"1em":s,l=t.capHeight,u=l===void 0?"0.71em":l,c=t.scaleToFit,f=c===void 0?!1:c,h=t.textAnchor,d=h===void 0?"start":h,p=t.verticalAnchor,m=p===void 0?"end":p,v=t.fill,b=v===void 0?H_:v,y=F_(t,xfe),x=C.useMemo(function(){return Efe({breakAll:y.breakAll,children:y.children,maxLines:y.maxLines,scaleToFit:f,style:y.style,width:y.width})},[y.breakAll,y.children,y.maxLines,f,y.style,y.width]),k=y.dx,w=y.dy,S=y.angle,O=y.className,A=y.breakAll,P=F_(y,wfe);if(!qt(r)||!qt(o))return null;var M=r+(ne(k)?k:0),j=o+(ne(w)?w:0),E;switch(m){case"start":E=Ox("calc(".concat(u,")"));break;case"middle":E=Ox("calc(".concat((x.length-1)/2," * -").concat(a," + (").concat(u," / 2))"));break;default:E=Ox("calc(".concat(x.length-1," * -").concat(a,")"));break}var D=[];if(f){var R=x[0].width,N=y.width;D.push("scale(".concat((ne(N)?N/R:1)/R,")"))}return S&&D.push("rotate(".concat(S,", ").concat(M,", ").concat(j,")")),D.length&&(P.transform=D.join(" ")),L.createElement("text",xS({},pe(P,!0),{x:M,y:j,className:Se("recharts-text",O),textAnchor:d,fill:b.includes("url")?H_:b}),x.map(function(B,F){var $=B.words.join(A?"":" ");return L.createElement("tspan",{x:M,dy:F===0?E:a,key:"".concat($,"-").concat(F)},$)}))};function Ss(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Tfe(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function CA(e){let t,n,r;e.length!==2?(t=Ss,n=(a,l)=>Ss(e(a),l),r=(a,l)=>e(a)-l):(t=e===Ss||e===Tfe?e:_fe,n=e,r=e);function i(a,l,u=0,c=a.length){if(u<c){if(t(l,l)!==0)return c;do{const f=u+c>>>1;n(a[f],l)<0?u=f+1:c=f}while(u<c)}return u}function o(a,l,u=0,c=a.length){if(u<c){if(t(l,l)!==0)return c;do{const f=u+c>>>1;n(a[f],l)<=0?u=f+1:c=f}while(u<c)}return u}function s(a,l,u=0,c=a.length){const f=i(a,l,u,c-1);return f>u&&r(a[f-1],l)>-r(a[f],l)?f-1:f}return{left:i,center:s,right:o}}function _fe(){return 0}function e4(e){return e===null?NaN:+e}function*jfe(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Mfe=CA(Ss),ep=Mfe.right;CA(e4).center;class V_ extends Map{constructor(t,n=Rfe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(q_(this,t))}has(t){return super.has(q_(this,t))}set(t,n){return super.set(Ife(this,t),n)}delete(t){return super.delete(Nfe(this,t))}}function q_({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Ife({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Nfe({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Rfe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Dfe(e=Ss){if(e===Ss)return t4;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function t4(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Lfe=Math.sqrt(50),$fe=Math.sqrt(10),Bfe=Math.sqrt(2);function iy(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=Lfe?10:o>=$fe?5:o>=Bfe?2:1;let a,l,u;return i<0?(u=Math.pow(10,-i)/s,a=Math.round(e*u),l=Math.round(t*u),a/u<e&&++a,l/u>t&&--l,u=-u):(u=Math.pow(10,i)*s,a=Math.round(e/u),l=Math.round(t/u),a*u<e&&++a,l*u>t&&--l),l<a&&.5<=n&&n<2?iy(e,t,n*2):[a,l,u]}function wS(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,o,s]=r?iy(t,e,n):iy(e,t,n);if(!(o>=i))return[];const a=o-i+1,l=new Array(a);if(r)if(s<0)for(let u=0;u<a;++u)l[u]=(o-u)/-s;else for(let u=0;u<a;++u)l[u]=(o-u)*s;else if(s<0)for(let u=0;u<a;++u)l[u]=(i+u)/-s;else for(let u=0;u<a;++u)l[u]=(i+u)*s;return l}function SS(e,t,n){return t=+t,e=+e,n=+n,iy(e,t,n)[2]}function kS(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?SS(t,e,n):SS(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function K_(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function G_(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function n4(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?t4:Dfe(i);r>n;){if(r-n>600){const l=r-n+1,u=t-n+1,c=Math.log(l),f=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*f*(l-f)/l)*(u-l/2<0?-1:1),d=Math.max(n,Math.floor(t-u*f/l+h)),p=Math.min(r,Math.floor(t+(l-u)*f/l+h));n4(e,t,d,p,i)}const o=e[t];let s=n,a=r;for(df(e,n,t),i(e[r],o)>0&&df(e,n,r);s<a;){for(df(e,s,a),++s,--a;i(e[s],o)<0;)++s;for(;i(e[a],o)>0;)--a}i(e[n],o)===0?df(e,n,a):(++a,df(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}return e}function df(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Ffe(e,t,n){if(e=Float64Array.from(jfe(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return G_(e);if(t>=1)return K_(e);var r,i=(r-1)*t,o=Math.floor(i),s=K_(n4(e,o).subarray(0,o+1)),a=G_(e.subarray(o+1));return s+(a-s)*(i-o)}}function zfe(e,t,n=e4){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),s=+n(e[o],o,e),a=+n(e[o+1],o+1,e);return s+(a-s)*(i-o)}}function Wfe(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}function Yr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function zo(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const OS=Symbol("implicit");function AA(){var e=new V_,t=[],n=[],r=OS;function i(o){let s=e.get(o);if(s===void 0){if(r!==OS)return r;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new V_;for(const s of o)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return AA(t,n).unknown(r)},Yr.apply(i,arguments),i}function Qh(){var e=AA().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,s,a=!1,l=0,u=0,c=.5;delete e.unknown;function f(){var h=t().length,d=i<r,p=d?i:r,m=d?r:i;o=(m-p)/Math.max(1,h-l+u*2),a&&(o=Math.floor(o)),p+=(m-p-o*(h-l))*c,s=o*(1-l),a&&(p=Math.round(p),s=Math.round(s));var v=Wfe(h).map(function(b){return p+o*b});return n(d?v.reverse():v)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,f()):[r,i]},e.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,a=!0,f()},e.bandwidth=function(){return s},e.step=function(){return o},e.round=function(h){return arguments.length?(a=!!h,f()):a},e.padding=function(h){return arguments.length?(l=Math.min(1,u=+h),f()):l},e.paddingInner=function(h){return arguments.length?(l=Math.min(1,h),f()):l},e.paddingOuter=function(h){return arguments.length?(u=+h,f()):u},e.align=function(h){return arguments.length?(c=Math.max(0,Math.min(1,h)),f()):c},e.copy=function(){return Qh(t(),[r,i]).round(a).paddingInner(l).paddingOuter(u).align(c)},Yr.apply(f(),arguments)}function r4(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return r4(t())},e}function Zf(){return r4(Qh.apply(null,arguments).paddingInner(1))}function PA(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function i4(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function tp(){}var Xh=.7,oy=1/Xh,wu="\\s*([+-]?\\d+)\\s*",Yh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ui="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ufe=/^#([0-9a-f]{3,8})$/,Hfe=new RegExp(`^rgb\\(${wu},${wu},${wu}\\)$`),Vfe=new RegExp(`^rgb\\(${Ui},${Ui},${Ui}\\)$`),qfe=new RegExp(`^rgba\\(${wu},${wu},${wu},${Yh}\\)$`),Kfe=new RegExp(`^rgba\\(${Ui},${Ui},${Ui},${Yh}\\)$`),Gfe=new RegExp(`^hsl\\(${Yh},${Ui},${Ui}\\)$`),Qfe=new RegExp(`^hsla\\(${Yh},${Ui},${Ui},${Yh}\\)$`),Q_={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};PA(tp,Zh,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:X_,formatHex:X_,formatHex8:Xfe,formatHsl:Yfe,formatRgb:Y_,toString:Y_});function X_(){return this.rgb().formatHex()}function Xfe(){return this.rgb().formatHex8()}function Yfe(){return o4(this).formatHsl()}function Y_(){return this.rgb().formatRgb()}function Zh(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ufe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Z_(t):n===3?new qn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Gp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Gp(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Hfe.exec(e))?new qn(t[1],t[2],t[3],1):(t=Vfe.exec(e))?new qn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=qfe.exec(e))?Gp(t[1],t[2],t[3],t[4]):(t=Kfe.exec(e))?Gp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Gfe.exec(e))?tj(t[1],t[2]/100,t[3]/100,1):(t=Qfe.exec(e))?tj(t[1],t[2]/100,t[3]/100,t[4]):Q_.hasOwnProperty(e)?Z_(Q_[e]):e==="transparent"?new qn(NaN,NaN,NaN,0):null}function Z_(e){return new qn(e>>16&255,e>>8&255,e&255,1)}function Gp(e,t,n,r){return r<=0&&(e=t=n=NaN),new qn(e,t,n,r)}function Zfe(e){return e instanceof tp||(e=Zh(e)),e?(e=e.rgb(),new qn(e.r,e.g,e.b,e.opacity)):new qn}function CS(e,t,n,r){return arguments.length===1?Zfe(e):new qn(e,t,n,r??1)}function qn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}PA(qn,CS,i4(tp,{brighter(e){return e=e==null?oy:Math.pow(oy,e),new qn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Xh:Math.pow(Xh,e),new qn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new qn(Ra(this.r),Ra(this.g),Ra(this.b),sy(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:J_,formatHex:J_,formatHex8:Jfe,formatRgb:ej,toString:ej}));function J_(){return`#${ka(this.r)}${ka(this.g)}${ka(this.b)}`}function Jfe(){return`#${ka(this.r)}${ka(this.g)}${ka(this.b)}${ka((isNaN(this.opacity)?1:this.opacity)*255)}`}function ej(){const e=sy(this.opacity);return`${e===1?"rgb(":"rgba("}${Ra(this.r)}, ${Ra(this.g)}, ${Ra(this.b)}${e===1?")":`, ${e})`}`}function sy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ra(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ka(e){return e=Ra(e),(e<16?"0":"")+e.toString(16)}function tj(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ui(e,t,n,r)}function o4(e){if(e instanceof ui)return new ui(e.h,e.s,e.l,e.opacity);if(e instanceof tp||(e=Zh(e)),!e)return new ui;if(e instanceof ui)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(t===o?s=(n-r)/a+(n<r)*6:n===o?s=(r-t)/a+2:s=(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new ui(s,a,l,e.opacity)}function ehe(e,t,n,r){return arguments.length===1?o4(e):new ui(e,t,n,r??1)}function ui(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}PA(ui,ehe,i4(tp,{brighter(e){return e=e==null?oy:Math.pow(oy,e),new ui(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Xh:Math.pow(Xh,e),new ui(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new qn(Cx(e>=240?e-240:e+120,i,r),Cx(e,i,r),Cx(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ui(nj(this.h),Qp(this.s),Qp(this.l),sy(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=sy(this.opacity);return`${e===1?"hsl(":"hsla("}${nj(this.h)}, ${Qp(this.s)*100}%, ${Qp(this.l)*100}%${e===1?")":`, ${e})`}`}}));function nj(e){return e=(e||0)%360,e<0?e+360:e}function Qp(e){return Math.max(0,Math.min(1,e||0))}function Cx(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const EA=e=>()=>e;function the(e,t){return function(n){return e+n*t}}function nhe(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function rhe(e){return(e=+e)==1?s4:function(t,n){return n-t?nhe(t,n,e):EA(isNaN(t)?n:t)}}function s4(e,t){var n=t-e;return n?the(e,n):EA(isNaN(e)?t:e)}const rj=function e(t){var n=rhe(t);function r(i,o){var s=n((i=CS(i)).r,(o=CS(o)).r),a=n(i.g,o.g),l=n(i.b,o.b),u=s4(i.opacity,o.opacity);return function(c){return i.r=s(c),i.g=a(c),i.b=l(c),i.opacity=u(c),i+""}}return r.gamma=e,r}(1);function ihe(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=e[i]*(1-o)+t[i]*o;return r}}function ohe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function she(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),s;for(s=0;s<r;++s)i[s]=Bc(e[s],t[s]);for(;s<n;++s)o[s]=t[s];return function(a){for(s=0;s<r;++s)o[s]=i[s](a);return o}}function ahe(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function ay(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function lhe(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Bc(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var AS=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ax=new RegExp(AS.source,"g");function uhe(e){return function(){return e}}function che(e){return function(t){return e(t)+""}}function fhe(e,t){var n=AS.lastIndex=Ax.lastIndex=0,r,i,o,s=-1,a=[],l=[];for(e=e+"",t=t+"";(r=AS.exec(e))&&(i=Ax.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:ay(r,i)})),n=Ax.lastIndex;return n<t.length&&(o=t.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?l[0]?che(l[0].x):uhe(t):(t=l.length,function(u){for(var c=0,f;c<t;++c)a[(f=l[c]).i]=f.x(u);return a.join("")})}function Bc(e,t){var n=typeof t,r;return t==null||n==="boolean"?EA(t):(n==="number"?ay:n==="string"?(r=Zh(t))?(t=r,rj):fhe:t instanceof Zh?rj:t instanceof Date?ahe:ohe(t)?ihe:Array.isArray(t)?she:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?lhe:ay)(e,t)}function TA(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function hhe(e,t){t===void 0&&(t=e,e=Bc);for(var n=0,r=t.length-1,i=t[0],o=new Array(r<0?0:r);n<r;)o[n]=e(i,i=t[++n]);return function(s){var a=Math.max(0,Math.min(r-1,Math.floor(s*=r)));return o[a](s-a)}}function dhe(e){return function(){return e}}function ly(e){return+e}var ij=[0,1];function Nn(e){return e}function PS(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:dhe(isNaN(t)?NaN:.5)}function phe(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function mhe(e,t,n){var r=e[0],i=e[1],o=t[0],s=t[1];return i<r?(r=PS(i,r),o=n(s,o)):(r=PS(r,i),o=n(o,s)),function(a){return o(r(a))}}function ghe(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=PS(e[s],e[s+1]),o[s]=n(t[s],t[s+1]);return function(a){var l=ep(e,a,1,r)-1;return o[l](i[l](a))}}function np(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function A0(){var e=ij,t=ij,n=Bc,r,i,o,s=Nn,a,l,u;function c(){var h=Math.min(e.length,t.length);return s!==Nn&&(s=phe(e[0],e[h-1])),a=h>2?ghe:mhe,l=u=null,f}function f(h){return h==null||isNaN(h=+h)?o:(l||(l=a(e.map(r),t,n)))(r(s(h)))}return f.invert=function(h){return s(i((u||(u=a(t,e.map(r),ay)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,ly),c()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),c()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),n=TA,c()},f.clamp=function(h){return arguments.length?(s=h?!0:Nn,c()):s!==Nn},f.interpolate=function(h){return arguments.length?(n=h,c()):n},f.unknown=function(h){return arguments.length?(o=h,f):o},function(h,d){return r=h,i=d,c()}}function _A(){return A0()(Nn,Nn)}function yhe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function uy(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Gu(e){return e=uy(Math.abs(e)),e?e[1]:NaN}function vhe(e,t){return function(n,r){for(var i=n.length,o=[],s=0,a=e[0],l=0;i>0&&a>0&&(l+a+1>r&&(a=Math.max(1,r-l)),o.push(n.substring(i-=a,i+a)),!((l+=a+1)>r));)a=e[s=(s+1)%e.length];return o.reverse().join(t)}}function bhe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var xhe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Jh(e){if(!(t=xhe.exec(e)))throw new Error("invalid format: "+e);var t;return new jA({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Jh.prototype=jA.prototype;function jA(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}jA.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function whe(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var cy;function She(e,t){var n=uy(e,t);if(!n)return cy=void 0,e.toPrecision(t);var r=n[0],i=n[1],o=i-(cy=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+uy(e,Math.max(0,t+o-1))[0]}function oj(e,t){var n=uy(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const sj={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:yhe,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>oj(e*100,t),r:oj,s:She,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function aj(e){return e}var lj=Array.prototype.map,uj=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function khe(e){var t=e.grouping===void 0||e.thousands===void 0?aj:vhe(lj.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?aj:bhe(lj.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(f,h){f=Jh(f);var d=f.fill,p=f.align,m=f.sign,v=f.symbol,b=f.zero,y=f.width,x=f.comma,k=f.precision,w=f.trim,S=f.type;S==="n"?(x=!0,S="g"):sj[S]||(k===void 0&&(k=12),w=!0,S="g"),(b||d==="0"&&p==="=")&&(b=!0,d="0",p="=");var O=(h&&h.prefix!==void 0?h.prefix:"")+(v==="$"?n:v==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():""),A=(v==="$"?r:/[%p]/.test(S)?s:"")+(h&&h.suffix!==void 0?h.suffix:""),P=sj[S],M=/[defgprs%]/.test(S);k=k===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,k)):Math.max(0,Math.min(20,k));function j(E){var D=O,R=A,N,B,F;if(S==="c")R=P(E)+R,E="";else{E=+E;var $=E<0||1/E<0;if(E=isNaN(E)?l:P(Math.abs(E),k),w&&(E=whe(E)),$&&+E==0&&m!=="+"&&($=!1),D=($?m==="("?m:a:m==="-"||m==="("?"":m)+D,R=(S==="s"&&!isNaN(E)&&cy!==void 0?uj[8+cy/3]:"")+R+($&&m==="("?")":""),M){for(N=-1,B=E.length;++N<B;)if(F=E.charCodeAt(N),48>F||F>57){R=(F===46?i+E.slice(N+1):E.slice(N))+R,E=E.slice(0,N);break}}}x&&!b&&(E=t(E,1/0));var z=D.length+E.length+R.length,T=z<y?new Array(y-z+1).join(d):"";switch(x&&b&&(E=t(T+E,T.length?y-R.length:1/0),T=""),p){case"<":E=D+E+R+T;break;case"=":E=D+T+E+R;break;case"^":E=T.slice(0,z=T.length>>1)+D+E+R+T.slice(z);break;default:E=T+D+E+R;break}return o(E)}return j.toString=function(){return f+""},j}function c(f,h){var d=Math.max(-8,Math.min(8,Math.floor(Gu(h)/3)))*3,p=Math.pow(10,-d),m=u((f=Jh(f),f.type="f",f),{suffix:uj[8+d/3]});return function(v){return m(p*v)}}return{format:u,formatPrefix:c}}var Xp,MA,a4;Ohe({thousands:",",grouping:[3],currency:["$",""]});function Ohe(e){return Xp=khe(e),MA=Xp.format,a4=Xp.formatPrefix,Xp}function Che(e){return Math.max(0,-Gu(Math.abs(e)))}function Ahe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Gu(t)/3)))*3-Gu(Math.abs(e)))}function Phe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Gu(t)-Gu(e))+1}function l4(e,t,n,r){var i=kS(e,t,n),o;switch(r=Jh(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=Ahe(i,s))&&(r.precision=o),a4(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=Phe(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=Che(i))&&(r.precision=o-(r.type==="%")*2);break}}return MA(r)}function Hs(e){var t=e.domain;return e.ticks=function(n){var r=t();return wS(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return l4(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,s=r[i],a=r[o],l,u,c=10;for(a<s&&(u=s,s=a,a=u,u=i,i=o,o=u);c-- >0;){if(u=SS(s,a,n),u===l)return r[i]=s,r[o]=a,t(r);if(u>0)s=Math.floor(s/u)*u,a=Math.ceil(a/u)*u;else if(u<0)s=Math.ceil(s*u)/u,a=Math.floor(a*u)/u;else break;l=u}return e},e}function fy(){var e=_A();return e.copy=function(){return np(e,fy())},Yr.apply(e,arguments),Hs(e)}function u4(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,ly),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return u4(e).unknown(t)},e=arguments.length?Array.from(e,ly):[0,1],Hs(n)}function c4(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],o=e[r],s;return o<i&&(s=n,n=r,r=s,s=i,i=o,o=s),e[n]=t.floor(i),e[r]=t.ceil(o),e}function cj(e){return Math.log(e)}function fj(e){return Math.exp(e)}function Ehe(e){return-Math.log(-e)}function The(e){return-Math.exp(-e)}function _he(e){return isFinite(e)?+("1e"+e):e<0?0:e}function jhe(e){return e===10?_he:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Mhe(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function hj(e){return(t,n)=>-e(-t,n)}function IA(e){const t=e(cj,fj),n=t.domain;let r=10,i,o;function s(){return i=Mhe(r),o=jhe(r),n()[0]<0?(i=hj(i),o=hj(o),e(Ehe,The)):e(cj,fj),t}return t.base=function(a){return arguments.length?(r=+a,s()):r},t.domain=function(a){return arguments.length?(n(a),s()):n()},t.ticks=a=>{const l=n();let u=l[0],c=l[l.length-1];const f=c<u;f&&([u,c]=[c,u]);let h=i(u),d=i(c),p,m;const v=a==null?10:+a;let b=[];if(!(r%1)&&d-h<v){if(h=Math.floor(h),d=Math.ceil(d),u>0){for(;h<=d;++h)for(p=1;p<r;++p)if(m=h<0?p/o(-h):p*o(h),!(m<u)){if(m>c)break;b.push(m)}}else for(;h<=d;++h)for(p=r-1;p>=1;--p)if(m=h>0?p/o(-h):p*o(h),!(m<u)){if(m>c)break;b.push(m)}b.length*2<v&&(b=wS(u,c,v))}else b=wS(h,d,Math.min(d-h,v)).map(o);return f?b.reverse():b},t.tickFormat=(a,l)=>{if(a==null&&(a=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Jh(l)).precision==null&&(l.trim=!0),l=MA(l)),a===1/0)return l;const u=Math.max(1,r*a/t.ticks().length);return c=>{let f=c/o(Math.round(i(c)));return f*r<r-.5&&(f*=r),f<=u?l(c):""}},t.nice=()=>n(c4(n(),{floor:a=>o(Math.floor(i(a))),ceil:a=>o(Math.ceil(i(a)))})),t}function f4(){const e=IA(A0()).domain([1,10]);return e.copy=()=>np(e,f4()).base(e.base()),Yr.apply(e,arguments),e}function dj(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function pj(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function NA(e){var t=1,n=e(dj(t),pj(t));return n.constant=function(r){return arguments.length?e(dj(t=+r),pj(t)):t},Hs(n)}function h4(){var e=NA(A0());return e.copy=function(){return np(e,h4()).constant(e.constant())},Yr.apply(e,arguments)}function mj(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Ihe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Nhe(e){return e<0?-e*e:e*e}function RA(e){var t=e(Nn,Nn),n=1;function r(){return n===1?e(Nn,Nn):n===.5?e(Ihe,Nhe):e(mj(n),mj(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Hs(t)}function DA(){var e=RA(A0());return e.copy=function(){return np(e,DA()).exponent(e.exponent())},Yr.apply(e,arguments),e}function Rhe(){return DA.apply(null,arguments).exponent(.5)}function gj(e){return Math.sign(e)*e*e}function Dhe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function d4(){var e=_A(),t=[0,1],n=!1,r;function i(o){var s=Dhe(e(o));return isNaN(s)?r:n?Math.round(s):s}return i.invert=function(o){return e.invert(gj(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,ly)).map(gj)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return d4(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Yr.apply(i,arguments),Hs(i)}function p4(){var e=[],t=[],n=[],r;function i(){var s=0,a=Math.max(1,t.length);for(n=new Array(a-1);++s<a;)n[s-1]=zfe(e,s/a);return o}function o(s){return s==null||isNaN(s=+s)?r:t[ep(n,s)]}return o.invertExtent=function(s){var a=t.indexOf(s);return a<0?[NaN,NaN]:[a>0?n[a-1]:e[0],a<n.length?n[a]:e[e.length-1]]},o.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let a of s)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(Ss),i()},o.range=function(s){return arguments.length?(t=Array.from(s),i()):t.slice()},o.unknown=function(s){return arguments.length?(r=s,o):r},o.quantiles=function(){return n.slice()},o.copy=function(){return p4().domain(e).range(t).unknown(r)},Yr.apply(o,arguments)}function m4(){var e=0,t=1,n=1,r=[.5],i=[0,1],o;function s(l){return l!=null&&l<=l?i[ep(r,l,0,n)]:o}function a(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*t-(l-n)*e)/(n+1);return s}return s.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,a()):[e,t]},s.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,a()):i.slice()},s.invertExtent=function(l){var u=i.indexOf(l);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},s.unknown=function(l){return arguments.length&&(o=l),s},s.thresholds=function(){return r.slice()},s.copy=function(){return m4().domain([e,t]).range(i).unknown(o)},Yr.apply(Hs(s),arguments)}function g4(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[ep(e,o,0,r)]:n}return i.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var s=t.indexOf(o);return[e[s-1],e[s]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return g4().domain(e).range(t).unknown(n)},Yr.apply(i,arguments)}const Px=new Date,Ex=new Date;function Gt(e,t,n,r){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const s=i(o),a=i.ceil(o);return o-s<a-o?s:a},i.offset=(o,s)=>(t(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,a)=>{const l=[];if(o=i.ceil(o),a=a==null?1:Math.floor(a),!(o<s)||!(a>0))return l;let u;do l.push(u=new Date(+o)),t(o,a),e(o);while(u<o&&o<s);return l},i.filter=o=>Gt(s=>{if(s>=s)for(;e(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;t(s,-1),!o(s););else for(;--a>=0;)for(;t(s,1),!o(s););}),n&&(i.count=(o,s)=>(Px.setTime(+o),Ex.setTime(+s),e(Px),e(Ex),Math.floor(n(Px,Ex))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?s=>r(s)%o===0:s=>i.count(0,s)%o===0):i)),i}const hy=Gt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);hy.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Gt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):hy);hy.range;const mo=1e3,Fr=mo*60,go=Fr*60,To=go*24,LA=To*7,yj=To*30,Tx=To*365,Oa=Gt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*mo)},(e,t)=>(t-e)/mo,e=>e.getUTCSeconds());Oa.range;const $A=Gt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*mo)},(e,t)=>{e.setTime(+e+t*Fr)},(e,t)=>(t-e)/Fr,e=>e.getMinutes());$A.range;const BA=Gt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Fr)},(e,t)=>(t-e)/Fr,e=>e.getUTCMinutes());BA.range;const FA=Gt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*mo-e.getMinutes()*Fr)},(e,t)=>{e.setTime(+e+t*go)},(e,t)=>(t-e)/go,e=>e.getHours());FA.range;const zA=Gt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*go)},(e,t)=>(t-e)/go,e=>e.getUTCHours());zA.range;const rp=Gt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Fr)/To,e=>e.getDate()-1);rp.range;const P0=Gt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/To,e=>e.getUTCDate()-1);P0.range;const y4=Gt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/To,e=>Math.floor(e/To));y4.range;function pl(e){return Gt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Fr)/LA)}const E0=pl(0),dy=pl(1),Lhe=pl(2),$he=pl(3),Qu=pl(4),Bhe=pl(5),Fhe=pl(6);E0.range;dy.range;Lhe.range;$he.range;Qu.range;Bhe.range;Fhe.range;function ml(e){return Gt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/LA)}const T0=ml(0),py=ml(1),zhe=ml(2),Whe=ml(3),Xu=ml(4),Uhe=ml(5),Hhe=ml(6);T0.range;py.range;zhe.range;Whe.range;Xu.range;Uhe.range;Hhe.range;const WA=Gt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());WA.range;const UA=Gt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());UA.range;const _o=Gt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());_o.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Gt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});_o.range;const jo=Gt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());jo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Gt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});jo.range;function v4(e,t,n,r,i,o){const s=[[Oa,1,mo],[Oa,5,5*mo],[Oa,15,15*mo],[Oa,30,30*mo],[o,1,Fr],[o,5,5*Fr],[o,15,15*Fr],[o,30,30*Fr],[i,1,go],[i,3,3*go],[i,6,6*go],[i,12,12*go],[r,1,To],[r,2,2*To],[n,1,LA],[t,1,yj],[t,3,3*yj],[e,1,Tx]];function a(u,c,f){const h=c<u;h&&([u,c]=[c,u]);const d=f&&typeof f.range=="function"?f:l(u,c,f),p=d?d.range(u,+c+1):[];return h?p.reverse():p}function l(u,c,f){const h=Math.abs(c-u)/f,d=CA(([,,v])=>v).right(s,h);if(d===s.length)return e.every(kS(u/Tx,c/Tx,f));if(d===0)return hy.every(Math.max(kS(u,c,f),1));const[p,m]=s[h/s[d-1][2]<s[d][2]/h?d-1:d];return p.every(m)}return[a,l]}const[Vhe,qhe]=v4(jo,UA,T0,y4,zA,BA),[Khe,Ghe]=v4(_o,WA,E0,rp,FA,$A);function _x(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function jx(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function pf(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Qhe(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,s=e.shortDays,a=e.months,l=e.shortMonths,u=mf(i),c=gf(i),f=mf(o),h=gf(o),d=mf(s),p=gf(s),m=mf(a),v=gf(a),b=mf(l),y=gf(l),x={a:F,A:$,b:z,B:T,c:null,d:kj,e:kj,f:vde,g:Ede,G:_de,H:mde,I:gde,j:yde,L:b4,m:bde,M:xde,p:q,q:I,Q:Aj,s:Pj,S:wde,u:Sde,U:kde,V:Ode,w:Cde,W:Ade,x:null,X:null,y:Pde,Y:Tde,Z:jde,"%":Cj},k={a:_,A:K,b:Q,B:te,c:null,d:Oj,e:Oj,f:Rde,g:Vde,G:Kde,H:Mde,I:Ide,j:Nde,L:w4,m:Dde,M:Lde,p:he,q:ve,Q:Aj,s:Pj,S:$de,u:Bde,U:Fde,V:zde,w:Wde,W:Ude,x:null,X:null,y:Hde,Y:qde,Z:Gde,"%":Cj},w={a:M,A:j,b:E,B:D,c:R,d:wj,e:wj,f:fde,g:xj,G:bj,H:Sj,I:Sj,j:ade,L:cde,m:sde,M:lde,p:P,q:ode,Q:dde,s:pde,S:ude,u:ede,U:tde,V:nde,w:Jhe,W:rde,x:N,X:B,y:xj,Y:bj,Z:ide,"%":hde};x.x=S(n,x),x.X=S(r,x),x.c=S(t,x),k.x=S(n,k),k.X=S(r,k),k.c=S(t,k);function S(X,ue){return function(ge){var Y=[],Qe=-1,Pe=0,dt=X.length,at,Mt,nn;for(ge instanceof Date||(ge=new Date(+ge));++Qe<dt;)X.charCodeAt(Qe)===37&&(Y.push(X.slice(Pe,Qe)),(Mt=vj[at=X.charAt(++Qe)])!=null?at=X.charAt(++Qe):Mt=at==="e"?" ":"0",(nn=ue[at])&&(at=nn(ge,Mt)),Y.push(at),Pe=Qe+1);return Y.push(X.slice(Pe,Qe)),Y.join("")}}function O(X,ue){return function(ge){var Y=pf(1900,void 0,1),Qe=A(Y,X,ge+="",0),Pe,dt;if(Qe!=ge.length)return null;if("Q"in Y)return new Date(Y.Q);if("s"in Y)return new Date(Y.s*1e3+("L"in Y?Y.L:0));if(ue&&!("Z"in Y)&&(Y.Z=0),"p"in Y&&(Y.H=Y.H%12+Y.p*12),Y.m===void 0&&(Y.m="q"in Y?Y.q:0),"V"in Y){if(Y.V<1||Y.V>53)return null;"w"in Y||(Y.w=1),"Z"in Y?(Pe=jx(pf(Y.y,0,1)),dt=Pe.getUTCDay(),Pe=dt>4||dt===0?py.ceil(Pe):py(Pe),Pe=P0.offset(Pe,(Y.V-1)*7),Y.y=Pe.getUTCFullYear(),Y.m=Pe.getUTCMonth(),Y.d=Pe.getUTCDate()+(Y.w+6)%7):(Pe=_x(pf(Y.y,0,1)),dt=Pe.getDay(),Pe=dt>4||dt===0?dy.ceil(Pe):dy(Pe),Pe=rp.offset(Pe,(Y.V-1)*7),Y.y=Pe.getFullYear(),Y.m=Pe.getMonth(),Y.d=Pe.getDate()+(Y.w+6)%7)}else("W"in Y||"U"in Y)&&("w"in Y||(Y.w="u"in Y?Y.u%7:"W"in Y?1:0),dt="Z"in Y?jx(pf(Y.y,0,1)).getUTCDay():_x(pf(Y.y,0,1)).getDay(),Y.m=0,Y.d="W"in Y?(Y.w+6)%7+Y.W*7-(dt+5)%7:Y.w+Y.U*7-(dt+6)%7);return"Z"in Y?(Y.H+=Y.Z/100|0,Y.M+=Y.Z%100,jx(Y)):_x(Y)}}function A(X,ue,ge,Y){for(var Qe=0,Pe=ue.length,dt=ge.length,at,Mt;Qe<Pe;){if(Y>=dt)return-1;if(at=ue.charCodeAt(Qe++),at===37){if(at=ue.charAt(Qe++),Mt=w[at in vj?ue.charAt(Qe++):at],!Mt||(Y=Mt(X,ge,Y))<0)return-1}else if(at!=ge.charCodeAt(Y++))return-1}return Y}function P(X,ue,ge){var Y=u.exec(ue.slice(ge));return Y?(X.p=c.get(Y[0].toLowerCase()),ge+Y[0].length):-1}function M(X,ue,ge){var Y=d.exec(ue.slice(ge));return Y?(X.w=p.get(Y[0].toLowerCase()),ge+Y[0].length):-1}function j(X,ue,ge){var Y=f.exec(ue.slice(ge));return Y?(X.w=h.get(Y[0].toLowerCase()),ge+Y[0].length):-1}function E(X,ue,ge){var Y=b.exec(ue.slice(ge));return Y?(X.m=y.get(Y[0].toLowerCase()),ge+Y[0].length):-1}function D(X,ue,ge){var Y=m.exec(ue.slice(ge));return Y?(X.m=v.get(Y[0].toLowerCase()),ge+Y[0].length):-1}function R(X,ue,ge){return A(X,t,ue,ge)}function N(X,ue,ge){return A(X,n,ue,ge)}function B(X,ue,ge){return A(X,r,ue,ge)}function F(X){return s[X.getDay()]}function $(X){return o[X.getDay()]}function z(X){return l[X.getMonth()]}function T(X){return a[X.getMonth()]}function q(X){return i[+(X.getHours()>=12)]}function I(X){return 1+~~(X.getMonth()/3)}function _(X){return s[X.getUTCDay()]}function K(X){return o[X.getUTCDay()]}function Q(X){return l[X.getUTCMonth()]}function te(X){return a[X.getUTCMonth()]}function he(X){return i[+(X.getUTCHours()>=12)]}function ve(X){return 1+~~(X.getUTCMonth()/3)}return{format:function(X){var ue=S(X+="",x);return ue.toString=function(){return X},ue},parse:function(X){var ue=O(X+="",!1);return ue.toString=function(){return X},ue},utcFormat:function(X){var ue=S(X+="",k);return ue.toString=function(){return X},ue},utcParse:function(X){var ue=O(X+="",!0);return ue.toString=function(){return X},ue}}}var vj={"-":"",_:" ",0:"0"},tn=/^\s*\d+/,Xhe=/^%/,Yhe=/[\\^$*+?|[\]().{}]/g;function Be(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function Zhe(e){return e.replace(Yhe,"\\$&")}function mf(e){return new RegExp("^(?:"+e.map(Zhe).join("|")+")","i")}function gf(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Jhe(e,t,n){var r=tn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function ede(e,t,n){var r=tn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function tde(e,t,n){var r=tn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function nde(e,t,n){var r=tn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function rde(e,t,n){var r=tn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function bj(e,t,n){var r=tn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function xj(e,t,n){var r=tn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function ide(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function ode(e,t,n){var r=tn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function sde(e,t,n){var r=tn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function wj(e,t,n){var r=tn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function ade(e,t,n){var r=tn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Sj(e,t,n){var r=tn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function lde(e,t,n){var r=tn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function ude(e,t,n){var r=tn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function cde(e,t,n){var r=tn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function fde(e,t,n){var r=tn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function hde(e,t,n){var r=Xhe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function dde(e,t,n){var r=tn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function pde(e,t,n){var r=tn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function kj(e,t){return Be(e.getDate(),t,2)}function mde(e,t){return Be(e.getHours(),t,2)}function gde(e,t){return Be(e.getHours()%12||12,t,2)}function yde(e,t){return Be(1+rp.count(_o(e),e),t,3)}function b4(e,t){return Be(e.getMilliseconds(),t,3)}function vde(e,t){return b4(e,t)+"000"}function bde(e,t){return Be(e.getMonth()+1,t,2)}function xde(e,t){return Be(e.getMinutes(),t,2)}function wde(e,t){return Be(e.getSeconds(),t,2)}function Sde(e){var t=e.getDay();return t===0?7:t}function kde(e,t){return Be(E0.count(_o(e)-1,e),t,2)}function x4(e){var t=e.getDay();return t>=4||t===0?Qu(e):Qu.ceil(e)}function Ode(e,t){return e=x4(e),Be(Qu.count(_o(e),e)+(_o(e).getDay()===4),t,2)}function Cde(e){return e.getDay()}function Ade(e,t){return Be(dy.count(_o(e)-1,e),t,2)}function Pde(e,t){return Be(e.getFullYear()%100,t,2)}function Ede(e,t){return e=x4(e),Be(e.getFullYear()%100,t,2)}function Tde(e,t){return Be(e.getFullYear()%1e4,t,4)}function _de(e,t){var n=e.getDay();return e=n>=4||n===0?Qu(e):Qu.ceil(e),Be(e.getFullYear()%1e4,t,4)}function jde(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Be(t/60|0,"0",2)+Be(t%60,"0",2)}function Oj(e,t){return Be(e.getUTCDate(),t,2)}function Mde(e,t){return Be(e.getUTCHours(),t,2)}function Ide(e,t){return Be(e.getUTCHours()%12||12,t,2)}function Nde(e,t){return Be(1+P0.count(jo(e),e),t,3)}function w4(e,t){return Be(e.getUTCMilliseconds(),t,3)}function Rde(e,t){return w4(e,t)+"000"}function Dde(e,t){return Be(e.getUTCMonth()+1,t,2)}function Lde(e,t){return Be(e.getUTCMinutes(),t,2)}function $de(e,t){return Be(e.getUTCSeconds(),t,2)}function Bde(e){var t=e.getUTCDay();return t===0?7:t}function Fde(e,t){return Be(T0.count(jo(e)-1,e),t,2)}function S4(e){var t=e.getUTCDay();return t>=4||t===0?Xu(e):Xu.ceil(e)}function zde(e,t){return e=S4(e),Be(Xu.count(jo(e),e)+(jo(e).getUTCDay()===4),t,2)}function Wde(e){return e.getUTCDay()}function Ude(e,t){return Be(py.count(jo(e)-1,e),t,2)}function Hde(e,t){return Be(e.getUTCFullYear()%100,t,2)}function Vde(e,t){return e=S4(e),Be(e.getUTCFullYear()%100,t,2)}function qde(e,t){return Be(e.getUTCFullYear()%1e4,t,4)}function Kde(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Xu(e):Xu.ceil(e),Be(e.getUTCFullYear()%1e4,t,4)}function Gde(){return"+0000"}function Cj(){return"%"}function Aj(e){return+e}function Pj(e){return Math.floor(+e/1e3)}var Pl,k4,O4;Qde({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Qde(e){return Pl=Qhe(e),k4=Pl.format,Pl.parse,O4=Pl.utcFormat,Pl.utcParse,Pl}function Xde(e){return new Date(e)}function Yde(e){return e instanceof Date?+e:+new Date(+e)}function HA(e,t,n,r,i,o,s,a,l,u){var c=_A(),f=c.invert,h=c.domain,d=u(".%L"),p=u(":%S"),m=u("%I:%M"),v=u("%I %p"),b=u("%a %d"),y=u("%b %d"),x=u("%B"),k=u("%Y");function w(S){return(l(S)<S?d:a(S)<S?p:s(S)<S?m:o(S)<S?v:r(S)<S?i(S)<S?b:y:n(S)<S?x:k)(S)}return c.invert=function(S){return new Date(f(S))},c.domain=function(S){return arguments.length?h(Array.from(S,Yde)):h().map(Xde)},c.ticks=function(S){var O=h();return e(O[0],O[O.length-1],S??10)},c.tickFormat=function(S,O){return O==null?w:u(O)},c.nice=function(S){var O=h();return(!S||typeof S.range!="function")&&(S=t(O[0],O[O.length-1],S??10)),S?h(c4(O,S)):c},c.copy=function(){return np(c,HA(e,t,n,r,i,o,s,a,l,u))},c}function Zde(){return Yr.apply(HA(Khe,Ghe,_o,WA,E0,rp,FA,$A,Oa,k4).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Jde(){return Yr.apply(HA(Vhe,qhe,jo,UA,T0,P0,zA,BA,Oa,O4).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function _0(){var e=0,t=1,n,r,i,o,s=Nn,a=!1,l;function u(f){return f==null||isNaN(f=+f)?l:s(i===0?.5:(f=(o(f)-n)*i,a?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,n=o(e=+e),r=o(t=+t),i=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(f){return arguments.length?(a=!!f,u):a},u.interpolator=function(f){return arguments.length?(s=f,u):s};function c(f){return function(h){var d,p;return arguments.length?([d,p]=h,s=f(d,p),u):[s(0),s(1)]}}return u.range=c(Bc),u.rangeRound=c(TA),u.unknown=function(f){return arguments.length?(l=f,u):l},function(f){return o=f,n=f(e),r=f(t),i=n===r?0:1/(r-n),u}}function Vs(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function C4(){var e=Hs(_0()(Nn));return e.copy=function(){return Vs(e,C4())},zo.apply(e,arguments)}function A4(){var e=IA(_0()).domain([1,10]);return e.copy=function(){return Vs(e,A4()).base(e.base())},zo.apply(e,arguments)}function P4(){var e=NA(_0());return e.copy=function(){return Vs(e,P4()).constant(e.constant())},zo.apply(e,arguments)}function VA(){var e=RA(_0());return e.copy=function(){return Vs(e,VA()).exponent(e.exponent())},zo.apply(e,arguments)}function epe(){return VA.apply(null,arguments).exponent(.5)}function E4(){var e=[],t=Nn;function n(r){if(r!=null&&!isNaN(r=+r))return t((ep(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Ss),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>Ffe(e,o/r))},n.copy=function(){return E4(t).domain(e)},zo.apply(n,arguments)}function j0(){var e=0,t=.5,n=1,r=1,i,o,s,a,l,u=Nn,c,f=!1,h;function d(m){return isNaN(m=+m)?h:(m=.5+((m=+c(m))-o)*(r*m<r*o?a:l),u(f?Math.max(0,Math.min(1,m)):m))}d.domain=function(m){return arguments.length?([e,t,n]=m,i=c(e=+e),o=c(t=+t),s=c(n=+n),a=i===o?0:.5/(o-i),l=o===s?0:.5/(s-o),r=o<i?-1:1,d):[e,t,n]},d.clamp=function(m){return arguments.length?(f=!!m,d):f},d.interpolator=function(m){return arguments.length?(u=m,d):u};function p(m){return function(v){var b,y,x;return arguments.length?([b,y,x]=v,u=hhe(m,[b,y,x]),d):[u(0),u(.5),u(1)]}}return d.range=p(Bc),d.rangeRound=p(TA),d.unknown=function(m){return arguments.length?(h=m,d):h},function(m){return c=m,i=m(e),o=m(t),s=m(n),a=i===o?0:.5/(o-i),l=o===s?0:.5/(s-o),r=o<i?-1:1,d}}function T4(){var e=Hs(j0()(Nn));return e.copy=function(){return Vs(e,T4())},zo.apply(e,arguments)}function _4(){var e=IA(j0()).domain([.1,1,10]);return e.copy=function(){return Vs(e,_4()).base(e.base())},zo.apply(e,arguments)}function j4(){var e=NA(j0());return e.copy=function(){return Vs(e,j4()).constant(e.constant())},zo.apply(e,arguments)}function qA(){var e=RA(j0());return e.copy=function(){return Vs(e,qA()).exponent(e.exponent())},zo.apply(e,arguments)}function tpe(){return qA.apply(null,arguments).exponent(.5)}const Ej=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Qh,scaleDiverging:T4,scaleDivergingLog:_4,scaleDivergingPow:qA,scaleDivergingSqrt:tpe,scaleDivergingSymlog:j4,scaleIdentity:u4,scaleImplicit:OS,scaleLinear:fy,scaleLog:f4,scaleOrdinal:AA,scalePoint:Zf,scalePow:DA,scaleQuantile:p4,scaleQuantize:m4,scaleRadial:d4,scaleSequential:C4,scaleSequentialLog:A4,scaleSequentialPow:VA,scaleSequentialQuantile:E4,scaleSequentialSqrt:epe,scaleSequentialSymlog:P4,scaleSqrt:Rhe,scaleSymlog:h4,scaleThreshold:g4,scaleTime:Zde,scaleUtc:Jde,tickFormat:l4},Symbol.toStringTag,{value:"Module"}));var npe=_c;function rpe(e,t,n){for(var r=-1,i=e.length;++r<i;){var o=e[r],s=t(o);if(s!=null&&(a===void 0?s===s&&!npe(s):n(s,a)))var a=s,l=o}return l}var M0=rpe;function ipe(e,t){return e>t}var M4=ipe,ope=M0,spe=M4,ape=$c;function lpe(e){return e&&e.length?ope(e,ape,spe):void 0}var upe=lpe;const I0=ze(upe);function cpe(e,t){return e<t}var I4=cpe,fpe=M0,hpe=I4,dpe=$c;function ppe(e){return e&&e.length?fpe(e,dpe,hpe):void 0}var mpe=ppe;const N0=ze(mpe);var gpe=oA,ype=Us,vpe=z3,bpe=rr;function xpe(e,t){var n=bpe(e)?gpe:vpe;return n(e,ype(t))}var wpe=xpe,Spe=B3,kpe=wpe;function Ope(e,t){return Spe(kpe(e,t),1)}var Cpe=Ope;const Ape=ze(Cpe);var Ppe=wA;function Epe(e,t){return Ppe(e,t)}var Tpe=Epe;const ip=ze(Tpe);var Fc=1e9,_pe={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},GA,gt=!0,Gr="[DecimalError] ",Da=Gr+"Invalid argument: ",KA=Gr+"Exponent out of range: ",zc=Math.floor,ca=Math.pow,jpe=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,vr,Qt=1e7,ft=7,N4=9007199254740991,my=zc(N4/ft),le={};le.absoluteValue=le.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};le.comparedTo=le.cmp=function(e){var t,n,r,i,o=this;if(e=new o.constructor(e),o.s!==e.s)return o.s||-e.s;if(o.e!==e.e)return o.e>e.e^o.s<0?1:-1;for(r=o.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(o.d[t]!==e.d[t])return o.d[t]>e.d[t]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1};le.decimalPlaces=le.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*ft;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};le.dividedBy=le.div=function(e){return So(this,new this.constructor(e))};le.dividedToIntegerBy=le.idiv=function(e){var t=this,n=t.constructor;return Ze(So(t,new n(e),0,1),n.precision)};le.equals=le.eq=function(e){return!this.cmp(e)};le.exponent=function(){return Lt(this)};le.greaterThan=le.gt=function(e){return this.cmp(e)>0};le.greaterThanOrEqualTo=le.gte=function(e){return this.cmp(e)>=0};le.isInteger=le.isint=function(){return this.e>this.d.length-2};le.isNegative=le.isneg=function(){return this.s<0};le.isPositive=le.ispos=function(){return this.s>0};le.isZero=function(){return this.s===0};le.lessThan=le.lt=function(e){return this.cmp(e)<0};le.lessThanOrEqualTo=le.lte=function(e){return this.cmp(e)<1};le.logarithm=le.log=function(e){var t,n=this,r=n.constructor,i=r.precision,o=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(vr))throw Error(Gr+"NaN");if(n.s<1)throw Error(Gr+(n.s?"NaN":"-Infinity"));return n.eq(vr)?new r(0):(gt=!1,t=So(ed(n,o),ed(e,o),o),gt=!0,Ze(t,i))};le.minus=le.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?L4(t,e):R4(t,(e.s=-e.s,e))};le.modulo=le.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Gr+"NaN");return n.s?(gt=!1,t=So(n,e,0,1).times(e),gt=!0,n.minus(t)):Ze(new r(n),i)};le.naturalExponential=le.exp=function(){return D4(this)};le.naturalLogarithm=le.ln=function(){return ed(this)};le.negated=le.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};le.plus=le.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?R4(t,e):L4(t,(e.s=-e.s,e))};le.precision=le.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Da+e);if(t=Lt(i)+1,r=i.d.length-1,n=r*ft+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};le.squareRoot=le.sqrt=function(){var e,t,n,r,i,o,s,a=this,l=a.constructor;if(a.s<1){if(!a.s)return new l(0);throw Error(Gr+"NaN")}for(e=Lt(a),gt=!1,i=Math.sqrt(+a),i==0||i==1/0?(t=Di(a.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=zc((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new l(t)):r=new l(i.toString()),n=l.precision,i=s=n+3;;)if(o=r,r=o.plus(So(a,o,s+2)).times(.5),Di(o.d).slice(0,s)===(t=Di(r.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(Ze(o,n+1,0),o.times(o).eq(a)){r=o;break}}else if(t!="9999")break;s+=4}return gt=!0,Ze(r,n)};le.times=le.mul=function(e){var t,n,r,i,o,s,a,l,u,c=this,f=c.constructor,h=c.d,d=(e=new f(e)).d;if(!c.s||!e.s)return new f(0);for(e.s*=c.s,n=c.e+e.e,l=h.length,u=d.length,l<u&&(o=h,h=d,d=o,s=l,l=u,u=s),o=[],s=l+u,r=s;r--;)o.push(0);for(r=u;--r>=0;){for(t=0,i=l+r;i>r;)a=o[i]+d[r]*h[i-r-1]+t,o[i--]=a%Qt|0,t=a/Qt|0;o[i]=(o[i]+t)%Qt|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,gt?Ze(e,f.precision):e};le.toDecimalPlaces=le.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Gi(e,0,Fc),t===void 0?t=r.rounding:Gi(t,0,8),Ze(n,e+Lt(n)+1,t))};le.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=el(r,!0):(Gi(e,0,Fc),t===void 0?t=i.rounding:Gi(t,0,8),r=Ze(new i(r),e+1,t),n=el(r,!0,e+1)),n};le.toFixed=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?el(i):(Gi(e,0,Fc),t===void 0?t=o.rounding:Gi(t,0,8),r=Ze(new o(i),e+Lt(i)+1,t),n=el(r.abs(),!1,e+Lt(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};le.toInteger=le.toint=function(){var e=this,t=e.constructor;return Ze(new t(e),Lt(e)+1,t.rounding)};le.toNumber=function(){return+this};le.toPower=le.pow=function(e){var t,n,r,i,o,s,a=this,l=a.constructor,u=12,c=+(e=new l(e));if(!e.s)return new l(vr);if(a=new l(a),!a.s){if(e.s<1)throw Error(Gr+"Infinity");return a}if(a.eq(vr))return a;if(r=l.precision,e.eq(vr))return Ze(a,r);if(t=e.e,n=e.d.length-1,s=t>=n,o=a.s,s){if((n=c<0?-c:c)<=N4){for(i=new l(vr),t=Math.ceil(r/ft+4),gt=!1;n%2&&(i=i.times(a),_j(i.d,t)),n=zc(n/2),n!==0;)a=a.times(a),_j(a.d,t);return gt=!0,e.s<0?new l(vr).div(i):Ze(i,r)}}else if(o<0)throw Error(Gr+"NaN");return o=o<0&&e.d[Math.max(t,n)]&1?-1:1,a.s=1,gt=!1,i=e.times(ed(a,r+u)),gt=!0,i=D4(i),i.s=o,i};le.toPrecision=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?(n=Lt(i),r=el(i,n<=o.toExpNeg||n>=o.toExpPos)):(Gi(e,1,Fc),t===void 0?t=o.rounding:Gi(t,0,8),i=Ze(new o(i),e,t),n=Lt(i),r=el(i,e<=n||n<=o.toExpNeg,e)),r};le.toSignificantDigits=le.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Gi(e,1,Fc),t===void 0?t=r.rounding:Gi(t,0,8)),Ze(new r(n),e,t)};le.toString=le.valueOf=le.val=le.toJSON=le[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Lt(e),n=e.constructor;return el(e,t<=n.toExpNeg||t>=n.toExpPos)};function R4(e,t){var n,r,i,o,s,a,l,u,c=e.constructor,f=c.precision;if(!e.s||!t.s)return t.s||(t=new c(e)),gt?Ze(t,f):t;if(l=e.d,u=t.d,s=e.e,i=t.e,l=l.slice(),o=s-i,o){for(o<0?(r=l,o=-o,a=u.length):(r=u,i=s,a=l.length),s=Math.ceil(f/ft),a=s>a?s+1:a+1,o>a&&(o=a,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(a=l.length,o=u.length,a-o<0&&(o=a,r=u,u=l,l=r),n=0;o;)n=(l[--o]=l[o]+u[o]+n)/Qt|0,l[o]%=Qt;for(n&&(l.unshift(n),++i),a=l.length;l[--a]==0;)l.pop();return t.d=l,t.e=i,gt?Ze(t,f):t}function Gi(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Da+e)}function Di(e){var t,n,r,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t<i;t++)r=e[t]+"",n=ft-r.length,n&&(o+=Qo(n)),o+=r;s=e[t],r=s+"",n=ft-r.length,n&&(o+=Qo(n))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}var So=function(){function e(r,i){var o,s=0,a=r.length;for(r=r.slice();a--;)o=r[a]*i+s,r[a]=o%Qt|0,s=o/Qt|0;return s&&r.unshift(s),r}function t(r,i,o,s){var a,l;if(o!=s)l=o>s?1:-1;else for(a=l=0;a<o;a++)if(r[a]!=i[a]){l=r[a]>i[a]?1:-1;break}return l}function n(r,i,o){for(var s=0;o--;)r[o]-=s,s=r[o]<i[o]?1:0,r[o]=s*Qt+r[o]-i[o];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,o,s){var a,l,u,c,f,h,d,p,m,v,b,y,x,k,w,S,O,A,P=r.constructor,M=r.s==i.s?1:-1,j=r.d,E=i.d;if(!r.s)return new P(r);if(!i.s)throw Error(Gr+"Division by zero");for(l=r.e-i.e,O=E.length,w=j.length,d=new P(M),p=d.d=[],u=0;E[u]==(j[u]||0);)++u;if(E[u]>(j[u]||0)&&--l,o==null?y=o=P.precision:s?y=o+(Lt(r)-Lt(i))+1:y=o,y<0)return new P(0);if(y=y/ft+2|0,u=0,O==1)for(c=0,E=E[0],y++;(u<w||c)&&y--;u++)x=c*Qt+(j[u]||0),p[u]=x/E|0,c=x%E|0;else{for(c=Qt/(E[0]+1)|0,c>1&&(E=e(E,c),j=e(j,c),O=E.length,w=j.length),k=O,m=j.slice(0,O),v=m.length;v<O;)m[v++]=0;A=E.slice(),A.unshift(0),S=E[0],E[1]>=Qt/2&&++S;do c=0,a=t(E,m,O,v),a<0?(b=m[0],O!=v&&(b=b*Qt+(m[1]||0)),c=b/S|0,c>1?(c>=Qt&&(c=Qt-1),f=e(E,c),h=f.length,v=m.length,a=t(f,m,h,v),a==1&&(c--,n(f,O<h?A:E,h))):(c==0&&(a=c=1),f=E.slice()),h=f.length,h<v&&f.unshift(0),n(m,f,v),a==-1&&(v=m.length,a=t(E,m,O,v),a<1&&(c++,n(m,O<v?A:E,v))),v=m.length):a===0&&(c++,m=[0]),p[u++]=c,a&&m[0]?m[v++]=j[k]||0:(m=[j[k]],v=1);while((k++<w||m[0]!==void 0)&&y--)}return p[0]||p.shift(),d.e=l,Ze(d,s?o+Lt(d)+1:o)}}();function D4(e,t){var n,r,i,o,s,a,l=0,u=0,c=e.constructor,f=c.precision;if(Lt(e)>16)throw Error(KA+Lt(e));if(!e.s)return new c(vr);for(gt=!1,a=f,s=new c(.03125);e.abs().gte(.1);)e=e.times(s),u+=5;for(r=Math.log(ca(2,u))/Math.LN10*2+5|0,a+=r,n=i=o=new c(vr),c.precision=a;;){if(i=Ze(i.times(e),a),n=n.times(++l),s=o.plus(So(i,n,a)),Di(s.d).slice(0,a)===Di(o.d).slice(0,a)){for(;u--;)o=Ze(o.times(o),a);return c.precision=f,t==null?(gt=!0,Ze(o,f)):o}o=s}}function Lt(e){for(var t=e.e*ft,n=e.d[0];n>=10;n/=10)t++;return t}function Mx(e,t,n){if(t>e.LN10.sd())throw gt=!0,n&&(e.precision=n),Error(Gr+"LN10 precision limit exceeded");return Ze(new e(e.LN10),t)}function Qo(e){for(var t="";e--;)t+="0";return t}function ed(e,t){var n,r,i,o,s,a,l,u,c,f=1,h=10,d=e,p=d.d,m=d.constructor,v=m.precision;if(d.s<1)throw Error(Gr+(d.s?"NaN":"-Infinity"));if(d.eq(vr))return new m(0);if(t==null?(gt=!1,u=v):u=t,d.eq(10))return t==null&&(gt=!0),Mx(m,u);if(u+=h,m.precision=u,n=Di(p),r=n.charAt(0),o=Lt(d),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)d=d.times(e),n=Di(d.d),r=n.charAt(0),f++;o=Lt(d),r>1?(d=new m("0."+n),o++):d=new m(r+"."+n.slice(1))}else return l=Mx(m,u+2,v).times(o+""),d=ed(new m(r+"."+n.slice(1)),u-h).plus(l),m.precision=v,t==null?(gt=!0,Ze(d,v)):d;for(a=s=d=So(d.minus(vr),d.plus(vr),u),c=Ze(d.times(d),u),i=3;;){if(s=Ze(s.times(c),u),l=a.plus(So(s,new m(i),u)),Di(l.d).slice(0,u)===Di(a.d).slice(0,u))return a=a.times(2),o!==0&&(a=a.plus(Mx(m,u+2,v).times(o+""))),a=So(a,new m(f),u),m.precision=v,t==null?(gt=!0,Ze(a,v)):a;a=l,i+=2}}function Tj(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=zc(n/ft),e.d=[],r=(n+1)%ft,n<0&&(r+=ft),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=ft;r<i;)e.d.push(+t.slice(r,r+=ft));t=t.slice(r),r=ft-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),gt&&(e.e>my||e.e<-my))throw Error(KA+n)}else e.s=0,e.e=0,e.d=[0];return e}function Ze(e,t,n){var r,i,o,s,a,l,u,c,f=e.d;for(s=1,o=f[0];o>=10;o/=10)s++;if(r=t-s,r<0)r+=ft,i=t,u=f[c=0];else{if(c=Math.ceil((r+1)/ft),o=f.length,c>=o)return e;for(u=o=f[c],s=1;o>=10;o/=10)s++;r%=ft,i=r-ft+s}if(n!==void 0&&(o=ca(10,s-i-1),a=u/o%10|0,l=t<0||f[c+1]!==void 0||u%o,l=n<4?(a||l)&&(n==0||n==(e.s<0?3:2)):a>5||a==5&&(n==4||l||n==6&&(r>0?i>0?u/ca(10,s-i):0:f[c-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return l?(o=Lt(e),f.length=1,t=t-o-1,f[0]=ca(10,(ft-t%ft)%ft),e.e=zc(-t/ft)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=c,o=1,c--):(f.length=c+1,o=ca(10,ft-r),f[c]=i>0?(u/ca(10,s-i)%ca(10,i)|0)*o:0),l)for(;;)if(c==0){(f[0]+=o)==Qt&&(f[0]=1,++e.e);break}else{if(f[c]+=o,f[c]!=Qt)break;f[c--]=0,o=1}for(r=f.length;f[--r]===0;)f.pop();if(gt&&(e.e>my||e.e<-my))throw Error(KA+Lt(e));return e}function L4(e,t){var n,r,i,o,s,a,l,u,c,f,h=e.constructor,d=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),gt?Ze(t,d):t;if(l=e.d,f=t.d,r=t.e,u=e.e,l=l.slice(),s=u-r,s){for(c=s<0,c?(n=l,s=-s,a=f.length):(n=f,r=u,a=l.length),i=Math.max(Math.ceil(d/ft),a)+2,s>i&&(s=i,n.length=1),n.reverse(),i=s;i--;)n.push(0);n.reverse()}else{for(i=l.length,a=f.length,c=i<a,c&&(a=i),i=0;i<a;i++)if(l[i]!=f[i]){c=l[i]<f[i];break}s=0}for(c&&(n=l,l=f,f=n,t.s=-t.s),a=l.length,i=f.length-a;i>0;--i)l[a++]=0;for(i=f.length;i>s;){if(l[--i]<f[i]){for(o=i;o&&l[--o]===0;)l[o]=Qt-1;--l[o],l[i]+=Qt}l[i]-=f[i]}for(;l[--a]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(t.d=l,t.e=r,gt?Ze(t,d):t):new h(0)}function el(e,t,n){var r,i=Lt(e),o=Di(e.d),s=o.length;return t?(n&&(r=n-s)>0?o=o.charAt(0)+"."+o.slice(1)+Qo(r):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+Qo(-i-1)+o,n&&(r=n-s)>0&&(o+=Qo(r))):i>=s?(o+=Qo(i+1-s),n&&(r=n-i-1)>0&&(o=o+"."+Qo(r))):((r=i+1)<s&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-s)>0&&(i+1===s&&(o+="."),o+=Qo(r))),e.s<0?"-"+o:o}function _j(e,t){if(e.length>t)return e.length=t,!0}function $4(e){var t,n,r;function i(o){var s=this;if(!(s instanceof i))return new i(o);if(s.constructor=i,o instanceof i){s.s=o.s,s.e=o.e,s.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(Da+o);if(o>0)s.s=1;else if(o<0)o=-o,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(o===~~o&&o<1e7){s.e=0,s.d=[o];return}return Tj(s,o.toString())}else if(typeof o!="string")throw Error(Da+o);if(o.charCodeAt(0)===45?(o=o.slice(1),s.s=-1):s.s=1,jpe.test(o))Tj(s,o);else throw Error(Da+o)}if(i.prototype=le,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=$4,i.config=i.set=Mpe,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function Mpe(e){if(!e||typeof e!="object")throw Error(Gr+"Object expected");var t,n,r,i=["precision",1,Fc,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(zc(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Da+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Da+n+": "+r);return this}var GA=$4(_pe);vr=new GA(1);const Ge=GA;function Ipe(e){return Lpe(e)||Dpe(e)||Rpe(e)||Npe()}function Npe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
305
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rpe(e,t){if(e){if(typeof e=="string")return ES(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ES(e,t)}}function Dpe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Lpe(e){if(Array.isArray(e))return ES(e)}function ES(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var $pe=function(t){return t},B4={},F4=function(t){return t===B4},jj=function(t){return function n(){return arguments.length===0||arguments.length===1&&F4(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},Bpe=function e(t,n){return t===1?n:jj(function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var s=i.filter(function(a){return a!==B4}).length;return s>=t?n.apply(void 0,i):e(t-s,jj(function(){for(var a=arguments.length,l=new Array(a),u=0;u<a;u++)l[u]=arguments[u];var c=i.map(function(f){return F4(f)?l.shift():f});return n.apply(void 0,Ipe(c).concat(l))}))})},R0=function(t){return Bpe(t.length,t)},TS=function(t,n){for(var r=[],i=t;i<n;++i)r[i-t]=i;return r},Fpe=R0(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),zpe=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return $pe;var i=n.reverse(),o=i[0],s=i.slice(1);return function(){return s.reduce(function(a,l){return l(a)},o.apply(void 0,arguments))}},_S=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},z4=function(t){var n=null,r=null;return function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n&&o.every(function(a,l){return a===n[l]})||(n=o,r=t.apply(void 0,o)),r}};function Wpe(e){var t;return e===0?t=1:t=Math.floor(new Ge(e).abs().log(10).toNumber())+1,t}function Upe(e,t,n){for(var r=new Ge(e),i=0,o=[];r.lt(t)&&i<1e5;)o.push(r.toNumber()),r=r.add(n),i++;return o}var Hpe=R0(function(e,t,n){var r=+e,i=+t;return r+n*(i-r)}),Vpe=R0(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),qpe=R0(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const D0={rangeStep:Upe,getDigitCount:Wpe,interpolateNumber:Hpe,uninterpolateNumber:Vpe,uninterpolateTruncation:qpe};function jS(e){return Qpe(e)||Gpe(e)||W4(e)||Kpe()}function Kpe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
306
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gpe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Qpe(e){if(Array.isArray(e))return MS(e)}function td(e,t){return Zpe(e)||Ype(e,t)||W4(e,t)||Xpe()}function Xpe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
307
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function W4(e,t){if(e){if(typeof e=="string")return MS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return MS(e,t)}}function MS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ype(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,o=void 0;try{for(var s=e[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(n.push(a.value),!(t&&n.length===t));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(i)throw o}}return n}}function Zpe(e){if(Array.isArray(e))return e}function U4(e){var t=td(e,2),n=t[0],r=t[1],i=n,o=r;return n>r&&(i=r,o=n),[i,o]}function H4(e,t,n){if(e.lte(0))return new Ge(0);var r=D0.getDigitCount(e.toNumber()),i=new Ge(10).pow(r),o=e.div(i),s=r!==1?.05:.1,a=new Ge(Math.ceil(o.div(s).toNumber())).add(n).mul(s),l=a.mul(i);return t?l:new Ge(Math.ceil(l))}function Jpe(e,t,n){var r=1,i=new Ge(e);if(!i.isint()&&n){var o=Math.abs(e);o<1?(r=new Ge(10).pow(D0.getDigitCount(e)-1),i=new Ge(Math.floor(i.div(r).toNumber())).mul(r)):o>1&&(i=new Ge(Math.floor(e)))}else e===0?i=new Ge(Math.floor((t-1)/2)):n||(i=new Ge(Math.floor(e)));var s=Math.floor((t-1)/2),a=zpe(Fpe(function(l){return i.add(new Ge(l-s).mul(r)).toNumber()}),TS);return a(0,t)}function V4(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new Ge(0),tickMin:new Ge(0),tickMax:new Ge(0)};var o=H4(new Ge(t).sub(e).div(n-1),r,i),s;e<=0&&t>=0?s=new Ge(0):(s=new Ge(e).add(t).div(2),s=s.sub(new Ge(s).mod(o)));var a=Math.ceil(s.sub(e).div(o).toNumber()),l=Math.ceil(new Ge(t).sub(s).div(o).toNumber()),u=a+l+1;return u>n?V4(e,t,n,r,i+1):(u<n&&(l=t>0?l+(n-u):l,a=t>0?a:a+(n-u)),{step:o,tickMin:s.sub(new Ge(a).mul(o)),tickMax:s.add(new Ge(l).mul(o))})}function eme(e){var t=td(e,2),n=t[0],r=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(i,2),a=U4([n,r]),l=td(a,2),u=l[0],c=l[1];if(u===-1/0||c===1/0){var f=c===1/0?[u].concat(jS(TS(0,i-1).map(function(){return 1/0}))):[].concat(jS(TS(0,i-1).map(function(){return-1/0})),[c]);return n>r?_S(f):f}if(u===c)return Jpe(u,i,o);var h=V4(u,c,s,o),d=h.step,p=h.tickMin,m=h.tickMax,v=D0.rangeStep(p,m.add(new Ge(.1).mul(d)),d);return n>r?_S(v):v}function tme(e,t){var n=td(e,2),r=n[0],i=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=U4([r,i]),a=td(s,2),l=a[0],u=a[1];if(l===-1/0||u===1/0)return[r,i];if(l===u)return[l];var c=Math.max(t,2),f=H4(new Ge(u).sub(l).div(c-1),o,0),h=[].concat(jS(D0.rangeStep(new Ge(l),new Ge(u).sub(new Ge(.99).mul(f)),f)),[u]);return r>i?_S(h):h}var nme=z4(eme),rme=z4(tme),ime="Invariant failed";function tl(e,t){throw new Error(ime)}var ome=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Yu(e){"@babel/helpers - typeof";return Yu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yu(e)}function gy(){return gy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gy.apply(this,arguments)}function sme(e,t){return cme(e)||ume(e,t)||lme(e,t)||ame()}function ame(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
308
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lme(e,t){if(e){if(typeof e=="string")return Mj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Mj(e,t)}}function Mj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ume(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function cme(e){if(Array.isArray(e))return e}function fme(e,t){if(e==null)return{};var n=hme(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function hme(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function dme(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pme(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,G4(r.key),r)}}function mme(e,t,n){return t&&pme(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function gme(e,t,n){return t=yy(t),yme(e,q4()?Reflect.construct(t,n||[],yy(e).constructor):t.apply(e,n))}function yme(e,t){if(t&&(Yu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vme(e)}function vme(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function q4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(q4=function(){return!!e})()}function yy(e){return yy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},yy(e)}function bme(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&IS(e,t)}function IS(e,t){return IS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},IS(e,t)}function K4(e,t,n){return t=G4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G4(e){var t=xme(e,"string");return Yu(t)=="symbol"?t:t+""}function xme(e,t){if(Yu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Yu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var op=function(e){function t(){return dme(this,t),gme(this,t,arguments)}return bme(t,e),mme(t,[{key:"render",value:function(){var r=this.props,i=r.offset,o=r.layout,s=r.width,a=r.dataKey,l=r.data,u=r.dataPointFormatter,c=r.xAxis,f=r.yAxis,h=fme(r,ome),d=pe(h,!1);this.props.direction==="x"&&c.type!=="number"&&tl();var p=l.map(function(m){var v=u(m,a),b=v.x,y=v.y,x=v.value,k=v.errorVal;if(!k)return null;var w=[],S,O;if(Array.isArray(k)){var A=sme(k,2);S=A[0],O=A[1]}else S=O=k;if(o==="vertical"){var P=c.scale,M=y+i,j=M+s,E=M-s,D=P(x-S),R=P(x+O);w.push({x1:R,y1:j,x2:R,y2:E}),w.push({x1:D,y1:M,x2:R,y2:M}),w.push({x1:D,y1:j,x2:D,y2:E})}else if(o==="horizontal"){var N=f.scale,B=b+i,F=B-s,$=B+s,z=N(x-S),T=N(x+O);w.push({x1:F,y1:T,x2:$,y2:T}),w.push({x1:B,y1:z,x2:B,y2:T}),w.push({x1:F,y1:z,x2:$,y2:z})}return L.createElement($e,gy({className:"recharts-errorBar",key:"bar-".concat(w.map(function(q){return"".concat(q.x1,"-").concat(q.x2,"-").concat(q.y1,"-").concat(q.y2)}))},d),w.map(function(q){return L.createElement("line",gy({},q,{key:"line-".concat(q.x1,"-").concat(q.x2,"-").concat(q.y1,"-").concat(q.y2)}))}))});return L.createElement($e,{className:"recharts-errorBars"},p)}}])}(L.Component);K4(op,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});K4(op,"displayName","ErrorBar");function nd(e){"@babel/helpers - typeof";return nd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nd(e)}function Ij(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ta(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ij(Object(n),!0).forEach(function(r){wme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ij(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wme(e,t,n){return t=Sme(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sme(e){var t=kme(e,"string");return nd(t)=="symbol"?t:t+""}function kme(e,t){if(nd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(nd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Q4=function(t){var n=t.children,r=t.formattedGraphicalItems,i=t.legendWidth,o=t.legendContent,s=pr(n,xu);if(!s)return null;var a=xu.defaultProps,l=a!==void 0?ta(ta({},a),s.props):{},u;return s.props&&s.props.payload?u=s.props&&s.props.payload:o==="children"?u=(r||[]).reduce(function(c,f){var h=f.item,d=f.props,p=d.sectors||d.data||[];return c.concat(p.map(function(m){return{type:s.props.iconType||h.props.legendType,value:m.name,color:m.fill,payload:m}}))},[]):u=(r||[]).map(function(c){var f=c.item,h=f.type.defaultProps,d=h!==void 0?ta(ta({},h),f.props):{},p=d.dataKey,m=d.name,v=d.legendType,b=d.hide;return{inactive:b,dataKey:p,type:l.iconType||v||"square",color:QA(f),value:m||p,payload:d}}),ta(ta(ta({},l),xu.getWithHeight(s,i)),{},{payload:u,item:s})};function rd(e){"@babel/helpers - typeof";return rd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rd(e)}function Nj(e){return Pme(e)||Ame(e)||Cme(e)||Ome()}function Ome(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
309
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cme(e,t){if(e){if(typeof e=="string")return NS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return NS(e,t)}}function Ame(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Pme(e){if(Array.isArray(e))return NS(e)}function NS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Rj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ct(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Rj(Object(n),!0).forEach(function(r){Su(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Su(e,t,n){return t=Eme(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Eme(e){var t=Tme(e,"string");return rd(t)=="symbol"?t:t+""}function Tme(e,t){if(rd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(rd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ut(e,t,n){return we(e)||we(t)?n:qt(t)?Or(e,t,n):xe(t)?t(e):n}function Jf(e,t,n,r){var i=Ape(e,function(a){return Ut(a,t)});if(n==="number"){var o=i.filter(function(a){return ne(a)||parseFloat(a)});return o.length?[N0(o),I0(o)]:[1/0,-1/0]}var s=r?i.filter(function(a){return!we(a)}):i;return s.map(function(a){return qt(a)||a instanceof Date?a:""})}var _me=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,s=-1,a=(n=r?.length)!==null&&n!==void 0?n:0;if(a<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var l=o.range,u=0;u<a;u++){var c=u>0?i[u-1].coordinate:i[a-1].coordinate,f=i[u].coordinate,h=u>=a-1?i[0].coordinate:i[u+1].coordinate,d=void 0;if(Mn(f-c)!==Mn(h-f)){var p=[];if(Mn(h-f)===Mn(l[1]-l[0])){d=h;var m=f+l[1]-l[0];p[0]=Math.min(m,(m+c)/2),p[1]=Math.max(m,(m+c)/2)}else{d=c;var v=h+l[1]-l[0];p[0]=Math.min(f,(v+f)/2),p[1]=Math.max(f,(v+f)/2)}var b=[Math.min(f,(d+f)/2),Math.max(f,(d+f)/2)];if(t>b[0]&&t<=b[1]||t>=p[0]&&t<=p[1]){s=i[u].index;break}}else{var y=Math.min(c,h),x=Math.max(c,h);if(t>(y+f)/2&&t<=(x+f)/2){s=i[u].index;break}}}else for(var k=0;k<a;k++)if(k===0&&t<=(r[k].coordinate+r[k+1].coordinate)/2||k>0&&k<a-1&&t>(r[k].coordinate+r[k-1].coordinate)/2&&t<=(r[k].coordinate+r[k+1].coordinate)/2||k===a-1&&t>(r[k].coordinate+r[k-1].coordinate)/2){s=r[k].index;break}return s},QA=function(t){var n,r=t,i=r.type.displayName,o=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Ct(Ct({},t.type.defaultProps),t.props):t.props,s=o.stroke,a=o.fill,l;switch(i){case"Line":l=s;break;case"Area":case"Radar":l=s&&s!=="none"?s:a;break;default:l=a;break}return l},jme=function(t){var n=t.barSize,r=t.totalSize,i=t.stackGroups,o=i===void 0?{}:i;if(!o)return{};for(var s={},a=Object.keys(o),l=0,u=a.length;l<u;l++)for(var c=o[a[l]].stackGroups,f=Object.keys(c),h=0,d=f.length;h<d;h++){var p=c[f[h]],m=p.items,v=p.cateAxisId,b=m.filter(function(O){return xo(O.type).indexOf("Bar")>=0});if(b&&b.length){var y=b[0].type.defaultProps,x=y!==void 0?Ct(Ct({},y),b[0].props):b[0].props,k=x.barSize,w=x[v];s[w]||(s[w]=[]);var S=we(k)?n:k;s[w].push({item:b[0],stackList:b.slice(1),barSize:we(S)?void 0:In(S,r,0)})}}return s},Mme=function(t){var n=t.barGap,r=t.barCategoryGap,i=t.bandSize,o=t.sizeList,s=o===void 0?[]:o,a=t.maxBarSize,l=s.length;if(l<1)return null;var u=In(n,i,0,!0),c,f=[];if(s[0].barSize===+s[0].barSize){var h=!1,d=i/l,p=s.reduce(function(k,w){return k+w.barSize||0},0);p+=(l-1)*u,p>=i&&(p-=(l-1)*u,u=0),p>=i&&d>0&&(h=!0,d*=.9,p=l*d);var m=(i-p)/2>>0,v={offset:m-u,size:0};c=s.reduce(function(k,w){var S={item:w.item,position:{offset:v.offset+v.size+u,size:h?d:w.barSize}},O=[].concat(Nj(k),[S]);return v=O[O.length-1].position,w.stackList&&w.stackList.length&&w.stackList.forEach(function(A){O.push({item:A,position:v})}),O},f)}else{var b=In(r,i,0,!0);i-2*b-(l-1)*u<=0&&(u=0);var y=(i-2*b-(l-1)*u)/l;y>1&&(y>>=0);var x=a===+a?Math.min(y,a):y;c=s.reduce(function(k,w,S){var O=[].concat(Nj(k),[{item:w.item,position:{offset:b+(y+u)*S+(y-x)/2,size:x}}]);return w.stackList&&w.stackList.length&&w.stackList.forEach(function(A){O.push({item:A,position:O[O.length-1].position})}),O},f)}return c},Ime=function(t,n,r,i){var o=r.children,s=r.width,a=r.margin,l=s-(a.left||0)-(a.right||0),u=Q4({children:o,legendWidth:l});if(u){var c=i||{},f=c.width,h=c.height,d=u.align,p=u.verticalAlign,m=u.layout;if((m==="vertical"||m==="horizontal"&&p==="middle")&&d!=="center"&&ne(t[d]))return Ct(Ct({},t),{},Su({},d,t[d]+(f||0)));if((m==="horizontal"||m==="vertical"&&d==="center")&&p!=="middle"&&ne(t[p]))return Ct(Ct({},t),{},Su({},p,t[p]+(h||0)))}return t},Nme=function(t,n,r){return we(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},X4=function(t,n,r,i,o){var s=n.props.children,a=Cr(s,op).filter(function(u){return Nme(i,o,u.props.direction)});if(a&&a.length){var l=a.map(function(u){return u.props.dataKey});return t.reduce(function(u,c){var f=Ut(c,r);if(we(f))return u;var h=Array.isArray(f)?[N0(f),I0(f)]:[f,f],d=l.reduce(function(p,m){var v=Ut(c,m,0),b=h[0]-Math.abs(Array.isArray(v)?v[0]:v),y=h[1]+Math.abs(Array.isArray(v)?v[1]:v);return[Math.min(b,p[0]),Math.max(y,p[1])]},[1/0,-1/0]);return[Math.min(d[0],u[0]),Math.max(d[1],u[1])]},[1/0,-1/0])}return null},Rme=function(t,n,r,i,o){var s=n.map(function(a){return X4(t,a,r,o,i)}).filter(function(a){return!we(a)});return s&&s.length?s.reduce(function(a,l){return[Math.min(a[0],l[0]),Math.max(a[1],l[1])]},[1/0,-1/0]):null},Y4=function(t,n,r,i,o){var s=n.map(function(l){var u=l.props.dataKey;return r==="number"&&u&&X4(t,l,u,i)||Jf(t,u,r,o)});if(r==="number")return s.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]);var a={};return s.reduce(function(l,u){for(var c=0,f=u.length;c<f;c++)a[u[c]]||(a[u[c]]=!0,l.push(u[c]));return l},[])},Z4=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},Ca=function(t,n,r){if(!t)return null;var i=t.scale,o=t.duplicateDomain,s=t.type,a=t.range,l=t.realScaleType==="scaleBand"?i.bandwidth()/2:2,u=(n||r)&&s==="category"&&i.bandwidth?i.bandwidth()/l:0;if(u=t.axisType==="angleAxis"&&a?.length>=2?Mn(a[0]-a[1])*2*u:u,n&&(t.ticks||t.niceTicks)){var c=(t.ticks||t.niceTicks).map(function(f){var h=o?o.indexOf(f):f;return{coordinate:i(h)+u,value:f,offset:u}});return c.filter(function(f){return!Jd(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,h){return{coordinate:i(f)+u,value:f,index:h,offset:u}}):i.ticks&&!r?i.ticks(t.tickCount).map(function(f){return{coordinate:i(f)+u,value:f,offset:u}}):i.domain().map(function(f,h){return{coordinate:i(f)+u,value:o?o[f]:f,index:h,offset:u}})},Ix=new WeakMap,Yp=function(t,n){if(typeof n!="function")return t;Ix.has(t)||Ix.set(t,new WeakMap);var r=Ix.get(t);if(r.has(n))return r.get(n);var i=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},J4=function(t,n,r){var i=t.scale,o=t.type,s=t.layout,a=t.axisType;if(i==="auto")return s==="radial"&&a==="radiusAxis"?{scale:Qh(),realScaleType:"band"}:s==="radial"&&a==="angleAxis"?{scale:fy(),realScaleType:"linear"}:o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:Zf(),realScaleType:"point"}:o==="category"?{scale:Qh(),realScaleType:"band"}:{scale:fy(),realScaleType:"linear"};if(Ya(i)){var l="scale".concat(b0(i));return{scale:(Ej[l]||Zf)(),realScaleType:Ej[l]?l:"point"}}return xe(i)?{scale:i}:{scale:Zf(),realScaleType:"point"}},Dj=1e-4,e5=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,i=t.range(),o=Math.min(i[0],i[1])-Dj,s=Math.max(i[0],i[1])+Dj,a=t(n[0]),l=t(n[r-1]);(a<o||a>s||l<o||l>s)&&t.domain([n[0],n[r-1]])}},Dme=function(t,n){if(!t)return null;for(var r=0,i=t.length;r<i;r++)if(t[r].item===n)return t[r].position;return null},Lme=function(t,n){if(!n||n.length!==2||!ne(n[0])||!ne(n[1]))return t;var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]),o=[t[0],t[1]];return(!ne(t[0])||t[0]<r)&&(o[0]=r),(!ne(t[1])||t[1]>i)&&(o[1]=i),o[0]>i&&(o[0]=i),o[1]<r&&(o[1]=r),o},$me=function(t){var n=t.length;if(!(n<=0))for(var r=0,i=t[0].length;r<i;++r)for(var o=0,s=0,a=0;a<n;++a){var l=Jd(t[a][r][1])?t[a][r][0]:t[a][r][1];l>=0?(t[a][r][0]=o,t[a][r][1]=o+l,o=t[a][r][1]):(t[a][r][0]=s,t[a][r][1]=s+l,s=t[a][r][1])}},Bme=function(t){var n=t.length;if(!(n<=0))for(var r=0,i=t[0].length;r<i;++r)for(var o=0,s=0;s<n;++s){var a=Jd(t[s][r][1])?t[s][r][0]:t[s][r][1];a>=0?(t[s][r][0]=o,t[s][r][1]=o+a,o=t[s][r][1]):(t[s][r][0]=0,t[s][r][1]=0)}},Fme={sign:$me,expand:ine,none:Wu,silhouette:one,wiggle:sne,positive:Bme},zme=function(t,n,r){var i=n.map(function(a){return a.props.dataKey}),o=Fme[r],s=rne().keys(i).value(function(a,l){return+Ut(a,l,0)}).order(oS).offset(o);return s(t)},Wme=function(t,n,r,i,o,s){if(!t)return null;var a=s?n.reverse():n,l={},u=a.reduce(function(f,h){var d,p=(d=h.type)!==null&&d!==void 0&&d.defaultProps?Ct(Ct({},h.type.defaultProps),h.props):h.props,m=p.stackId,v=p.hide;if(v)return f;var b=p[r],y=f[b]||{hasStack:!1,stackGroups:{}};if(qt(m)){var x=y.stackGroups[m]||{numericAxisId:r,cateAxisId:i,items:[]};x.items.push(h),y.hasStack=!0,y.stackGroups[m]=x}else y.stackGroups[Rc("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[h]};return Ct(Ct({},f),{},Su({},b,y))},l),c={};return Object.keys(u).reduce(function(f,h){var d=u[h];if(d.hasStack){var p={};d.stackGroups=Object.keys(d.stackGroups).reduce(function(m,v){var b=d.stackGroups[v];return Ct(Ct({},m),{},Su({},v,{numericAxisId:r,cateAxisId:i,items:b.items,stackedData:zme(t,b.items,o)}))},p)}return Ct(Ct({},f),{},Su({},h,d))},c)},t5=function(t,n){var r=n.realScaleType,i=n.type,o=n.tickCount,s=n.originalDomain,a=n.allowDecimals,l=r||n.scale;if(l!=="auto"&&l!=="linear")return null;if(o&&i==="number"&&s&&(s[0]==="auto"||s[1]==="auto")){var u=t.domain();if(!u.length)return null;var c=nme(u,o,a);return t.domain([N0(c),I0(c)]),{niceTicks:c}}if(o&&i==="number"){var f=t.domain(),h=rme(f,o,a);return{niceTicks:h}}return null};function Lj(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,o=e.index,s=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!we(i[t.dataKey])){var a=Ug(n,"value",i[t.dataKey]);if(a)return a.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var l=Ut(i,we(s)?t.dataKey:s);return we(l)?null:t.scale(l)}var $j=function(t){var n=t.axis,r=t.ticks,i=t.offset,o=t.bandSize,s=t.entry,a=t.index;if(n.type==="category")return r[a]?r[a].coordinate+i:null;var l=Ut(s,n.dataKey,n.domain[a]);return we(l)?null:n.scale(l)-o/2+i},Ume=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);return i<=0&&o>=0?0:o<0?o:i}return r[0]},Hme=function(t,n){var r,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Ct(Ct({},t.type.defaultProps),t.props):t.props,o=i.stackId;if(qt(o)){var s=n[o];if(s){var a=s.items.indexOf(t);return a>=0?s.stackedData[a]:null}}return null},Vme=function(t){return t.reduce(function(n,r){return[N0(r.concat([n[0]]).filter(ne)),I0(r.concat([n[1]]).filter(ne))]},[1/0,-1/0])},n5=function(t,n,r){return Object.keys(t).reduce(function(i,o){var s=t[o],a=s.stackedData,l=a.reduce(function(u,c){var f=Vme(c.slice(n,r+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},Bj=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Fj=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,RS=function(t,n,r){if(xe(t))return t(n,r);if(!Array.isArray(t))return n;var i=[];if(ne(t[0]))i[0]=r?t[0]:Math.min(t[0],n[0]);else if(Bj.test(t[0])){var o=+Bj.exec(t[0])[1];i[0]=n[0]-o}else xe(t[0])?i[0]=t[0](n[0]):i[0]=n[0];if(ne(t[1]))i[1]=r?t[1]:Math.max(t[1],n[1]);else if(Fj.test(t[1])){var s=+Fj.exec(t[1])[1];i[1]=n[1]+s}else xe(t[1])?i[1]=t[1](n[1]):i[1]=n[1];return i},vy=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!r||i>0)return i}if(t&&n&&n.length>=2){for(var o=kA(n,function(f){return f.coordinate}),s=1/0,a=1,l=o.length;a<l;a++){var u=o[a],c=o[a-1];s=Math.min((u.coordinate||0)-(c.coordinate||0),s)}return s===1/0?0:s}return r?void 0:0},zj=function(t,n,r){return!t||!t.length||ip(t,Or(r,"type.defaultProps.domain"))?n:t},r5=function(t,n){var r=t.type.defaultProps?Ct(Ct({},t.type.defaultProps),t.props):t.props,i=r.dataKey,o=r.name,s=r.unit,a=r.formatter,l=r.tooltipType,u=r.chartType,c=r.hide;return Ct(Ct({},pe(t,!1)),{},{dataKey:i,unit:s,formatter:a,name:o||i,color:QA(t),value:Ut(n,i),type:l,payload:n,chartType:u,hide:c})};function id(e){"@babel/helpers - typeof";return id=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},id(e)}function Wj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function oo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wj(Object(n),!0).forEach(function(r){i5(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function i5(e,t,n){return t=qme(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qme(e){var t=Kme(e,"string");return id(t)=="symbol"?t:t+""}function Kme(e,t){if(id(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(id(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gme(e,t){return Zme(e)||Yme(e,t)||Xme(e,t)||Qme()}function Qme(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
310
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xme(e,t){if(e){if(typeof e=="string")return Uj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Uj(e,t)}}function Uj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Yme(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function Zme(e){if(Array.isArray(e))return e}var by=Math.PI/180,Jme=function(t){return t*180/Math.PI},st=function(t,n,r,i){return{x:t+Math.cos(-by*i)*r,y:n+Math.sin(-by*i)*r}},o5=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},ege=function(t,n,r,i,o){var s=t.width,a=t.height,l=t.startAngle,u=t.endAngle,c=In(t.cx,s,s/2),f=In(t.cy,a,a/2),h=o5(s,a,r),d=In(t.innerRadius,h,0),p=In(t.outerRadius,h,h*.8),m=Object.keys(n);return m.reduce(function(v,b){var y=n[b],x=y.domain,k=y.reversed,w;if(we(y.range))i==="angleAxis"?w=[l,u]:i==="radiusAxis"&&(w=[d,p]),k&&(w=[w[1],w[0]]);else{w=y.range;var S=w,O=Gme(S,2);l=O[0],u=O[1]}var A=J4(y,o),P=A.realScaleType,M=A.scale;M.domain(x).range(w),e5(M);var j=t5(M,oo(oo({},y),{},{realScaleType:P})),E=oo(oo(oo({},y),j),{},{range:w,radius:p,realScaleType:P,scale:M,cx:c,cy:f,innerRadius:d,outerRadius:p,startAngle:l,endAngle:u});return oo(oo({},v),{},i5({},b,E))},{})},tge=function(t,n){var r=t.x,i=t.y,o=n.x,s=n.y;return Math.sqrt(Math.pow(r-o,2)+Math.pow(i-s,2))},nge=function(t,n){var r=t.x,i=t.y,o=n.cx,s=n.cy,a=tge({x:r,y:i},{x:o,y:s});if(a<=0)return{radius:a};var l=(r-o)/a,u=Math.acos(l);return i>s&&(u=2*Math.PI-u),{radius:a,angle:Jme(u),angleInRadian:u}},rge=function(t){var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),o=Math.floor(r/360),s=Math.min(i,o);return{startAngle:n-s*360,endAngle:r-s*360}},ige=function(t,n){var r=n.startAngle,i=n.endAngle,o=Math.floor(r/360),s=Math.floor(i/360),a=Math.min(o,s);return t+a*360},Hj=function(t,n){var r=t.x,i=t.y,o=nge({x:r,y:i},n),s=o.radius,a=o.angle,l=n.innerRadius,u=n.outerRadius;if(s<l||s>u)return!1;if(s===0)return!0;var c=rge(n),f=c.startAngle,h=c.endAngle,d=a,p;if(f<=h){for(;d>h;)d-=360;for(;d<f;)d+=360;p=d>=f&&d<=h}else{for(;d>f;)d-=360;for(;d<h;)d+=360;p=d>=h&&d<=f}return p?oo(oo({},n),{},{radius:s,angle:ige(d,n)}):null},s5=function(t){return!C.isValidElement(t)&&!xe(t)&&typeof t!="boolean"?t.className:""};function od(e){"@babel/helpers - typeof";return od=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},od(e)}var oge=["offset"];function sge(e){return cge(e)||uge(e)||lge(e)||age()}function age(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
311
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lge(e,t){if(e){if(typeof e=="string")return DS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return DS(e,t)}}function uge(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function cge(e){if(Array.isArray(e))return DS(e)}function DS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fge(e,t){if(e==null)return{};var n=hge(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function hge(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Vj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Vj(Object(n),!0).forEach(function(r){dge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dge(e,t,n){return t=pge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pge(e){var t=mge(e,"string");return od(t)=="symbol"?t:t+""}function mge(e,t){if(od(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(od(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sd(){return sd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sd.apply(this,arguments)}var gge=function(t){var n=t.value,r=t.formatter,i=we(t.children)?n:t.children;return xe(r)?r(i):i},yge=function(t,n){var r=Mn(n-t),i=Math.min(Math.abs(n-t),360);return r*i},vge=function(t,n,r){var i=t.position,o=t.viewBox,s=t.offset,a=t.className,l=o,u=l.cx,c=l.cy,f=l.innerRadius,h=l.outerRadius,d=l.startAngle,p=l.endAngle,m=l.clockWise,v=(f+h)/2,b=yge(d,p),y=b>=0?1:-1,x,k;i==="insideStart"?(x=d+y*s,k=m):i==="insideEnd"?(x=p-y*s,k=!m):i==="end"&&(x=p+y*s,k=m),k=b<=0?k:!k;var w=st(u,c,v,x),S=st(u,c,v,x+(k?1:-1)*359),O="M".concat(w.x,",").concat(w.y,`
|
|
312
|
-
A`).concat(v,",").concat(v,",0,1,").concat(k?0:1,`,
|
|
313
|
-
`).concat(S.x,",").concat(S.y),A=we(t.id)?Rc("recharts-radial-line-"):t.id;return L.createElement("text",sd({},r,{dominantBaseline:"central",className:Se("recharts-radial-bar-label",a)}),L.createElement("defs",null,L.createElement("path",{id:A,d:O})),L.createElement("textPath",{xlinkHref:"#".concat(A)},n))},bge=function(t){var n=t.viewBox,r=t.offset,i=t.position,o=n,s=o.cx,a=o.cy,l=o.innerRadius,u=o.outerRadius,c=o.startAngle,f=o.endAngle,h=(c+f)/2;if(i==="outside"){var d=st(s,a,u+r,h),p=d.x,m=d.y;return{x:p,y:m,textAnchor:p>=s?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:s,y:a,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:s,y:a,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:s,y:a,textAnchor:"middle",verticalAnchor:"end"};var v=(l+u)/2,b=st(s,a,v,h),y=b.x,x=b.y;return{x:y,y:x,textAnchor:"middle",verticalAnchor:"middle"}},xge=function(t){var n=t.viewBox,r=t.parentViewBox,i=t.offset,o=t.position,s=n,a=s.x,l=s.y,u=s.width,c=s.height,f=c>=0?1:-1,h=f*i,d=f>0?"end":"start",p=f>0?"start":"end",m=u>=0?1:-1,v=m*i,b=m>0?"end":"start",y=m>0?"start":"end";if(o==="top"){var x={x:a+u/2,y:l-f*i,textAnchor:"middle",verticalAnchor:d};return Bt(Bt({},x),r?{height:Math.max(l-r.y,0),width:u}:{})}if(o==="bottom"){var k={x:a+u/2,y:l+c+h,textAnchor:"middle",verticalAnchor:p};return Bt(Bt({},k),r?{height:Math.max(r.y+r.height-(l+c),0),width:u}:{})}if(o==="left"){var w={x:a-v,y:l+c/2,textAnchor:b,verticalAnchor:"middle"};return Bt(Bt({},w),r?{width:Math.max(w.x-r.x,0),height:c}:{})}if(o==="right"){var S={x:a+u+v,y:l+c/2,textAnchor:y,verticalAnchor:"middle"};return Bt(Bt({},S),r?{width:Math.max(r.x+r.width-S.x,0),height:c}:{})}var O=r?{width:u,height:c}:{};return o==="insideLeft"?Bt({x:a+v,y:l+c/2,textAnchor:y,verticalAnchor:"middle"},O):o==="insideRight"?Bt({x:a+u-v,y:l+c/2,textAnchor:b,verticalAnchor:"middle"},O):o==="insideTop"?Bt({x:a+u/2,y:l+h,textAnchor:"middle",verticalAnchor:p},O):o==="insideBottom"?Bt({x:a+u/2,y:l+c-h,textAnchor:"middle",verticalAnchor:d},O):o==="insideTopLeft"?Bt({x:a+v,y:l+h,textAnchor:y,verticalAnchor:p},O):o==="insideTopRight"?Bt({x:a+u-v,y:l+h,textAnchor:b,verticalAnchor:p},O):o==="insideBottomLeft"?Bt({x:a+v,y:l+c-h,textAnchor:y,verticalAnchor:d},O):o==="insideBottomRight"?Bt({x:a+u-v,y:l+c-h,textAnchor:b,verticalAnchor:d},O):jc(o)&&(ne(o.x)||Sa(o.x))&&(ne(o.y)||Sa(o.y))?Bt({x:a+In(o.x,u),y:l+In(o.y,c),textAnchor:"end",verticalAnchor:"end"},O):Bt({x:a+u/2,y:l+c/2,textAnchor:"middle",verticalAnchor:"middle"},O)},wge=function(t){return"cx"in t&&ne(t.cx)};function Yt(e){var t=e.offset,n=t===void 0?5:t,r=fge(e,oge),i=Bt({offset:n},r),o=i.viewBox,s=i.position,a=i.value,l=i.children,u=i.content,c=i.className,f=c===void 0?"":c,h=i.textBreakAll;if(!o||we(a)&&we(l)&&!C.isValidElement(u)&&!xe(u))return null;if(C.isValidElement(u))return C.cloneElement(u,i);var d;if(xe(u)){if(d=C.createElement(u,i),C.isValidElement(d))return d}else d=gge(i);var p=wge(o),m=pe(i,!0);if(p&&(s==="insideStart"||s==="insideEnd"||s==="end"))return vge(i,d,m);var v=p?bge(i):xge(i);return L.createElement(Ja,sd({className:Se("recharts-label",f)},m,v,{breakAll:h}),d)}Yt.displayName="Label";var a5=function(t){var n=t.cx,r=t.cy,i=t.angle,o=t.startAngle,s=t.endAngle,a=t.r,l=t.radius,u=t.innerRadius,c=t.outerRadius,f=t.x,h=t.y,d=t.top,p=t.left,m=t.width,v=t.height,b=t.clockWise,y=t.labelViewBox;if(y)return y;if(ne(m)&&ne(v)){if(ne(f)&&ne(h))return{x:f,y:h,width:m,height:v};if(ne(d)&&ne(p))return{x:d,y:p,width:m,height:v}}return ne(f)&&ne(h)?{x:f,y:h,width:0,height:0}:ne(n)&&ne(r)?{cx:n,cy:r,startAngle:o||i||0,endAngle:s||i||0,innerRadius:u||0,outerRadius:c||l||a||0,clockWise:b}:t.viewBox?t.viewBox:{}},Sge=function(t,n){return t?t===!0?L.createElement(Yt,{key:"label-implicit",viewBox:n}):qt(t)?L.createElement(Yt,{key:"label-implicit",viewBox:n,value:t}):C.isValidElement(t)?t.type===Yt?C.cloneElement(t,{key:"label-implicit",viewBox:n}):L.createElement(Yt,{key:"label-implicit",content:t,viewBox:n}):xe(t)?L.createElement(Yt,{key:"label-implicit",content:t,viewBox:n}):jc(t)?L.createElement(Yt,sd({viewBox:n},t,{key:"label-implicit"})):null:null},kge=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var i=t.children,o=a5(t),s=Cr(i,Yt).map(function(l,u){return C.cloneElement(l,{viewBox:n||o,key:"label-".concat(u)})});if(!r)return s;var a=Sge(t.label,n||o);return[a].concat(sge(s))};Yt.parseViewBox=a5;Yt.renderCallByParent=kge;function Oge(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var Cge=Oge;const Age=ze(Cge);function ad(e){"@babel/helpers - typeof";return ad=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ad(e)}var Pge=["valueAccessor"],Ege=["data","dataKey","clockWise","id","textBreakAll"];function Tge(e){return Ige(e)||Mge(e)||jge(e)||_ge()}function _ge(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
314
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jge(e,t){if(e){if(typeof e=="string")return LS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return LS(e,t)}}function Mge(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ige(e){if(Array.isArray(e))return LS(e)}function LS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xy(){return xy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xy.apply(this,arguments)}function qj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Kj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qj(Object(n),!0).forEach(function(r){Nge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nge(e,t,n){return t=Rge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rge(e){var t=Dge(e,"string");return ad(t)=="symbol"?t:t+""}function Dge(e,t){if(ad(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ad(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gj(e,t){if(e==null)return{};var n=Lge(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Lge(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var $ge=function(t){return Array.isArray(t.value)?Age(t.value):t.value};function ko(e){var t=e.valueAccessor,n=t===void 0?$ge:t,r=Gj(e,Pge),i=r.data,o=r.dataKey,s=r.clockWise,a=r.id,l=r.textBreakAll,u=Gj(r,Ege);return!i||!i.length?null:L.createElement($e,{className:"recharts-label-list"},i.map(function(c,f){var h=we(o)?n(c,f):Ut(c&&c.payload,o),d=we(a)?{}:{id:"".concat(a,"-").concat(f)};return L.createElement(Yt,xy({},pe(c,!0),u,d,{parentViewBox:c.parentViewBox,value:h,textBreakAll:l,viewBox:Yt.parseViewBox(we(s)?c:Kj(Kj({},c),{},{clockWise:s})),key:"label-".concat(f),index:f}))}))}ko.displayName="LabelList";function Bge(e,t){return e?e===!0?L.createElement(ko,{key:"labelList-implicit",data:t}):L.isValidElement(e)||xe(e)?L.createElement(ko,{key:"labelList-implicit",data:t,content:e}):jc(e)?L.createElement(ko,xy({data:t},e,{key:"labelList-implicit"})):null:null}function Fge(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,i=Cr(r,ko).map(function(s,a){return C.cloneElement(s,{data:t,key:"labelList-".concat(a)})});if(!n)return i;var o=Bge(e.label,t);return[o].concat(Tge(i))}ko.renderCallByParent=Fge;function ld(e){"@babel/helpers - typeof";return ld=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ld(e)}function $S(){return $S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$S.apply(this,arguments)}function Qj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Xj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Qj(Object(n),!0).forEach(function(r){zge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zge(e,t,n){return t=Wge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wge(e){var t=Uge(e,"string");return ld(t)=="symbol"?t:t+""}function Uge(e,t){if(ld(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ld(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Hge=function(t,n){var r=Mn(n-t),i=Math.min(Math.abs(n-t),359.999);return r*i},Zp=function(t){var n=t.cx,r=t.cy,i=t.radius,o=t.angle,s=t.sign,a=t.isExternal,l=t.cornerRadius,u=t.cornerIsExternal,c=l*(a?1:-1)+i,f=Math.asin(l/c)/by,h=u?o:o+s*f,d=st(n,r,c,h),p=st(n,r,i,h),m=u?o-s*f:o,v=st(n,r,c*Math.cos(f*by),m);return{center:d,circleTangency:p,lineTangency:v,theta:f}},l5=function(t){var n=t.cx,r=t.cy,i=t.innerRadius,o=t.outerRadius,s=t.startAngle,a=t.endAngle,l=Hge(s,a),u=s+l,c=st(n,r,o,s),f=st(n,r,o,u),h="M ".concat(c.x,",").concat(c.y,`
|
|
315
|
-
A `).concat(o,",").concat(o,`,0,
|
|
316
|
-
`).concat(+(Math.abs(l)>180),",").concat(+(s>u),`,
|
|
317
|
-
`).concat(f.x,",").concat(f.y,`
|
|
318
|
-
`);if(i>0){var d=st(n,r,i,s),p=st(n,r,i,u);h+="L ".concat(p.x,",").concat(p.y,`
|
|
319
|
-
A `).concat(i,",").concat(i,`,0,
|
|
320
|
-
`).concat(+(Math.abs(l)>180),",").concat(+(s<=u),`,
|
|
321
|
-
`).concat(d.x,",").concat(d.y," Z")}else h+="L ".concat(n,",").concat(r," Z");return h},Vge=function(t){var n=t.cx,r=t.cy,i=t.innerRadius,o=t.outerRadius,s=t.cornerRadius,a=t.forceCornerRadius,l=t.cornerIsExternal,u=t.startAngle,c=t.endAngle,f=Mn(c-u),h=Zp({cx:n,cy:r,radius:o,angle:u,sign:f,cornerRadius:s,cornerIsExternal:l}),d=h.circleTangency,p=h.lineTangency,m=h.theta,v=Zp({cx:n,cy:r,radius:o,angle:c,sign:-f,cornerRadius:s,cornerIsExternal:l}),b=v.circleTangency,y=v.lineTangency,x=v.theta,k=l?Math.abs(u-c):Math.abs(u-c)-m-x;if(k<0)return a?"M ".concat(p.x,",").concat(p.y,`
|
|
322
|
-
a`).concat(s,",").concat(s,",0,0,1,").concat(s*2,`,0
|
|
323
|
-
a`).concat(s,",").concat(s,",0,0,1,").concat(-s*2,`,0
|
|
324
|
-
`):l5({cx:n,cy:r,innerRadius:i,outerRadius:o,startAngle:u,endAngle:c});var w="M ".concat(p.x,",").concat(p.y,`
|
|
325
|
-
A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(d.x,",").concat(d.y,`
|
|
326
|
-
A`).concat(o,",").concat(o,",0,").concat(+(k>180),",").concat(+(f<0),",").concat(b.x,",").concat(b.y,`
|
|
327
|
-
A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(y.x,",").concat(y.y,`
|
|
328
|
-
`);if(i>0){var S=Zp({cx:n,cy:r,radius:i,angle:u,sign:f,isExternal:!0,cornerRadius:s,cornerIsExternal:l}),O=S.circleTangency,A=S.lineTangency,P=S.theta,M=Zp({cx:n,cy:r,radius:i,angle:c,sign:-f,isExternal:!0,cornerRadius:s,cornerIsExternal:l}),j=M.circleTangency,E=M.lineTangency,D=M.theta,R=l?Math.abs(u-c):Math.abs(u-c)-P-D;if(R<0&&s===0)return"".concat(w,"L").concat(n,",").concat(r,"Z");w+="L".concat(E.x,",").concat(E.y,`
|
|
329
|
-
A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(j.x,",").concat(j.y,`
|
|
330
|
-
A`).concat(i,",").concat(i,",0,").concat(+(R>180),",").concat(+(f>0),",").concat(O.x,",").concat(O.y,`
|
|
331
|
-
A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(A.x,",").concat(A.y,"Z")}else w+="L".concat(n,",").concat(r,"Z");return w},qge={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},u5=function(t){var n=Xj(Xj({},qge),t),r=n.cx,i=n.cy,o=n.innerRadius,s=n.outerRadius,a=n.cornerRadius,l=n.forceCornerRadius,u=n.cornerIsExternal,c=n.startAngle,f=n.endAngle,h=n.className;if(s<o||c===f)return null;var d=Se("recharts-sector",h),p=s-o,m=In(a,p,0,!0),v;return m>0&&Math.abs(c-f)<360?v=Vge({cx:r,cy:i,innerRadius:o,outerRadius:s,cornerRadius:Math.min(m,p/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:c,endAngle:f}):v=l5({cx:r,cy:i,innerRadius:o,outerRadius:s,startAngle:c,endAngle:f}),L.createElement("path",$S({},pe(n,!0),{className:d,d:v,role:"img"}))};function ud(e){"@babel/helpers - typeof";return ud=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ud(e)}function BS(){return BS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},BS.apply(this,arguments)}function Yj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Zj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Yj(Object(n),!0).forEach(function(r){Kge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kge(e,t,n){return t=Gge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gge(e){var t=Qge(e,"string");return ud(t)=="symbol"?t:t+""}function Qge(e,t){if(ud(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ud(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Jj={curveBasisClosed:qte,curveBasisOpen:Kte,curveBasis:Vte,curveBumpX:jte,curveBumpY:Mte,curveLinearClosed:Gte,curveLinear:w0,curveMonotoneX:Qte,curveMonotoneY:Xte,curveNatural:Yte,curveStep:Zte,curveStepAfter:ene,curveStepBefore:Jte},Jp=function(t){return t.x===+t.x&&t.y===+t.y},yf=function(t){return t.x},vf=function(t){return t.y},Xge=function(t,n){if(xe(t))return t;var r="curve".concat(b0(t));return(r==="curveMonotone"||r==="curveBump")&&n?Jj["".concat(r).concat(n==="vertical"?"Y":"X")]:Jj[r]||w0},Yge=function(t){var n=t.type,r=n===void 0?"linear":n,i=t.points,o=i===void 0?[]:i,s=t.baseLine,a=t.layout,l=t.connectNulls,u=l===void 0?!1:l,c=Xge(r,a),f=u?o.filter(function(m){return Jp(m)}):o,h;if(Array.isArray(s)){var d=u?s.filter(function(m){return Jp(m)}):s,p=f.map(function(m,v){return Zj(Zj({},m),{},{base:d[v]})});return a==="vertical"?h=Up().y(vf).x1(yf).x0(function(m){return m.base.x}):h=Up().x(yf).y1(vf).y0(function(m){return m.base.y}),h.defined(Jp).curve(c),h(p)}return a==="vertical"&&ne(s)?h=Up().y(vf).x1(yf).x0(s):ne(s)?h=Up().x(yf).y1(vf).y0(s):h=o3().x(yf).y(vf),h.defined(Jp).curve(c),h(f)},wy=function(t){var n=t.className,r=t.points,i=t.path,o=t.pathRef;if((!r||!r.length)&&!i)return null;var s=r&&r.length?Yge(t):i;return C.createElement("path",BS({},pe(t,!1),Hg(t),{className:Se("recharts-curve",n),d:s,ref:o}))},c5={exports:{}},Zge="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Jge=Zge,eye=Jge;function f5(){}function h5(){}h5.resetWarningCache=f5;var tye=function(){function e(r,i,o,s,a,l){if(l!==eye){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:h5,resetWarningCache:f5};return n.PropTypes=n,n};c5.exports=tye();var nye=c5.exports;const We=ze(nye),{getOwnPropertyNames:rye,getOwnPropertySymbols:iye}=Object,{hasOwnProperty:oye}=Object.prototype;function Nx(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function em(e){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i);const{cache:o}=i,s=o.get(n),a=o.get(r);if(s&&a)return s===r&&a===n;o.set(n,r),o.set(r,n);const l=e(n,r,i);return o.delete(n),o.delete(r),l}}function sye(e){return e?.[Symbol.toStringTag]}function eM(e){return rye(e).concat(iye(e))}const aye=Object.hasOwn||((e,t)=>oye.call(e,t));function gl(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const lye="__v",uye="__o",cye="_owner",{getOwnPropertyDescriptor:tM,keys:nM}=Object;function fye(e,t){return e.byteLength===t.byteLength&&Sy(new Uint8Array(e),new Uint8Array(t))}function hye(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function dye(e,t){return e.byteLength===t.byteLength&&Sy(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function pye(e,t){return gl(e.getTime(),t.getTime())}function mye(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function gye(e,t){return e===t}function rM(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),o=e.entries();let s,a,l=0;for(;(s=o.next())&&!s.done;){const u=t.entries();let c=!1,f=0;for(;(a=u.next())&&!a.done;){if(i[f]){f++;continue}const h=s.value,d=a.value;if(n.equals(h[0],d[0],l,f,e,t,n)&&n.equals(h[1],d[1],h[0],d[0],e,t,n)){c=i[f]=!0;break}f++}if(!c)return!1;l++}return!0}const yye=gl;function vye(e,t,n){const r=nM(e);let i=r.length;if(nM(t).length!==i)return!1;for(;i-- >0;)if(!d5(e,t,n,r[i]))return!1;return!0}function bf(e,t,n){const r=eM(e);let i=r.length;if(eM(t).length!==i)return!1;let o,s,a;for(;i-- >0;)if(o=r[i],!d5(e,t,n,o)||(s=tM(e,o),a=tM(t,o),(s||a)&&(!s||!a||s.configurable!==a.configurable||s.enumerable!==a.enumerable||s.writable!==a.writable)))return!1;return!0}function bye(e,t){return gl(e.valueOf(),t.valueOf())}function xye(e,t){return e.source===t.source&&e.flags===t.flags}function iM(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),o=e.values();let s,a;for(;(s=o.next())&&!s.done;){const l=t.values();let u=!1,c=0;for(;(a=l.next())&&!a.done;){if(!i[c]&&n.equals(s.value,a.value,s.value,a.value,e,t,n)){u=i[c]=!0;break}c++}if(!u)return!1}return!0}function Sy(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function wye(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function d5(e,t,n,r){return(r===cye||r===uye||r===lye)&&(e.$$typeof||t.$$typeof)?!0:aye(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const Sye="[object ArrayBuffer]",kye="[object Arguments]",Oye="[object Boolean]",Cye="[object DataView]",Aye="[object Date]",Pye="[object Error]",Eye="[object Map]",Tye="[object Number]",_ye="[object Object]",jye="[object RegExp]",Mye="[object Set]",Iye="[object String]",Nye={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Rye="[object URL]",Dye=Object.prototype.toString;function Lye({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:o,areMapsEqual:s,areNumbersEqual:a,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:c,areSetsEqual:f,areTypedArraysEqual:h,areUrlsEqual:d,unknownTagComparators:p}){return function(v,b,y){if(v===b)return!0;if(v==null||b==null)return!1;const x=typeof v;if(x!==typeof b)return!1;if(x!=="object")return x==="number"?a(v,b,y):x==="function"?o(v,b,y):!1;const k=v.constructor;if(k!==b.constructor)return!1;if(k===Object)return l(v,b,y);if(Array.isArray(v))return t(v,b,y);if(k===Date)return r(v,b,y);if(k===RegExp)return c(v,b,y);if(k===Map)return s(v,b,y);if(k===Set)return f(v,b,y);const w=Dye.call(v);if(w===Aye)return r(v,b,y);if(w===jye)return c(v,b,y);if(w===Eye)return s(v,b,y);if(w===Mye)return f(v,b,y);if(w===_ye)return typeof v.then!="function"&&typeof b.then!="function"&&l(v,b,y);if(w===Rye)return d(v,b,y);if(w===Pye)return i(v,b,y);if(w===kye)return l(v,b,y);if(Nye[w])return h(v,b,y);if(w===Sye)return e(v,b,y);if(w===Cye)return n(v,b,y);if(w===Oye||w===Tye||w===Iye)return u(v,b,y);if(p){let S=p[w];if(!S){const O=sye(v);O&&(S=p[O])}if(S)return S(v,b,y)}return!1}}function $ye({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:fye,areArraysEqual:n?bf:hye,areDataViewsEqual:dye,areDatesEqual:pye,areErrorsEqual:mye,areFunctionsEqual:gye,areMapsEqual:n?Nx(rM,bf):rM,areNumbersEqual:yye,areObjectsEqual:n?bf:vye,arePrimitiveWrappersEqual:bye,areRegExpsEqual:xye,areSetsEqual:n?Nx(iM,bf):iM,areTypedArraysEqual:n?Nx(Sy,bf):Sy,areUrlsEqual:wye,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const i=em(r.areArraysEqual),o=em(r.areMapsEqual),s=em(r.areObjectsEqual),a=em(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:a})}return r}function Bye(e){return function(t,n,r,i,o,s,a){return e(t,n,a)}}function Fye({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,l){const{cache:u=e?new WeakMap:void 0,meta:c}=n();return t(a,l,{cache:u,equals:r,meta:c,strict:i})};if(e)return function(a,l){return t(a,l,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const o={cache:void 0,equals:r,meta:void 0,strict:i};return function(a,l){return t(a,l,o)}}const zye=qs();qs({strict:!0});qs({circular:!0});qs({circular:!0,strict:!0});qs({createInternalComparator:()=>gl});qs({strict:!0,createInternalComparator:()=>gl});qs({circular:!0,createInternalComparator:()=>gl});qs({circular:!0,createInternalComparator:()=>gl,strict:!0});function qs(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,o=$ye(e),s=Lye(o),a=n?n(s):Bye(s);return Fye({circular:t,comparator:s,createState:r,equals:a,strict:i})}function Wye(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function oM(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(o){n<0&&(n=o),o-n>t?(e(o),n=-1):Wye(i)};requestAnimationFrame(r)}function FS(e){"@babel/helpers - typeof";return FS=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},FS(e)}function Uye(e){return Kye(e)||qye(e)||Vye(e)||Hye()}function Hye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
332
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vye(e,t){if(e){if(typeof e=="string")return sM(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sM(e,t)}}function sM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function qye(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Kye(e){if(Array.isArray(e))return e}function Gye(){var e={},t=function(){return null},n=!1,r=function i(o){if(!n){if(Array.isArray(o)){if(!o.length)return;var s=o,a=Uye(s),l=a[0],u=a.slice(1);if(typeof l=="number"){oM(i.bind(null,u),l);return}i(l),oM(i.bind(null,u));return}FS(o)==="object"&&(e=o,t(e)),typeof o=="function"&&o()}};return{stop:function(){n=!0},start:function(o){n=!1,r(o)},subscribe:function(o){return t=o,function(){t=function(){return null}}}}}function cd(e){"@babel/helpers - typeof";return cd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cd(e)}function aM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function lM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aM(Object(n),!0).forEach(function(r){p5(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function p5(e,t,n){return t=Qye(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qye(e){var t=Xye(e,"string");return cd(t)==="symbol"?t:String(t)}function Xye(e,t){if(cd(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(cd(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Yye=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,i){return r.filter(function(o){return i.includes(o)})})},Zye=function(t){return t},Jye=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},eh=function(t,n){return Object.keys(n).reduce(function(r,i){return lM(lM({},r),{},p5({},i,t(i,n[i])))},{})},uM=function(t,n,r){return t.map(function(i){return"".concat(Jye(i)," ").concat(n,"ms ").concat(r)}).join(",")};function eve(e,t){return rve(e)||nve(e,t)||m5(e,t)||tve()}function tve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
333
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nve(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function rve(e){if(Array.isArray(e))return e}function ive(e){return ave(e)||sve(e)||m5(e)||ove()}function ove(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
334
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function m5(e,t){if(e){if(typeof e=="string")return zS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zS(e,t)}}function sve(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ave(e){if(Array.isArray(e))return zS(e)}function zS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ky=1e-4,g5=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},y5=function(t,n){return t.map(function(r,i){return r*Math.pow(n,i)}).reduce(function(r,i){return r+i})},cM=function(t,n){return function(r){var i=g5(t,n);return y5(i,r)}},lve=function(t,n){return function(r){var i=g5(t,n),o=[].concat(ive(i.map(function(s,a){return s*a}).slice(1)),[0]);return y5(o,r)}},fM=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0],o=n[1],s=n[2],a=n[3];if(n.length===1)switch(n[0]){case"linear":i=0,o=0,s=1,a=1;break;case"ease":i=.25,o=.1,s=.25,a=1;break;case"ease-in":i=.42,o=0,s=1,a=1;break;case"ease-out":i=.42,o=0,s=.58,a=1;break;case"ease-in-out":i=0,o=0,s=.58,a=1;break;default:{var l=n[0].split("(");if(l[0]==="cubic-bezier"&&l[1].split(")")[0].split(",").length===4){var u=l[1].split(")")[0].split(",").map(function(v){return parseFloat(v)}),c=eve(u,4);i=c[0],o=c[1],s=c[2],a=c[3]}}}var f=cM(i,s),h=cM(o,a),d=lve(i,s),p=function(b){return b>1?1:b<0?0:b},m=function(b){for(var y=b>1?1:b,x=y,k=0;k<8;++k){var w=f(x)-y,S=d(x);if(Math.abs(w-y)<ky||S<ky)return h(x);x=p(x-w/S)}return h(x)};return m.isStepper=!1,m},uve=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,i=t.damping,o=i===void 0?8:i,s=t.dt,a=s===void 0?17:s,l=function(c,f,h){var d=-(c-f)*r,p=h*o,m=h+(d-p)*a/1e3,v=h*a/1e3+c;return Math.abs(v-f)<ky&&Math.abs(m)<ky?[f,0]:[v,m]};return l.isStepper=!0,l.dt=a,l},cve=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(typeof i=="string")switch(i){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return fM(i);case"spring":return uve();default:if(i.split("(")[0]==="cubic-bezier")return fM(i)}return typeof i=="function"?i:null};function fd(e){"@babel/helpers - typeof";return fd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fd(e)}function hM(e){return dve(e)||hve(e)||v5(e)||fve()}function fve(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
335
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hve(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function dve(e){if(Array.isArray(e))return US(e)}function dM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function on(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dM(Object(n),!0).forEach(function(r){WS(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WS(e,t,n){return t=pve(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pve(e){var t=mve(e,"string");return fd(t)==="symbol"?t:String(t)}function mve(e,t){if(fd(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(fd(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gve(e,t){return bve(e)||vve(e,t)||v5(e,t)||yve()}function yve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
336
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v5(e,t){if(e){if(typeof e=="string")return US(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return US(e,t)}}function US(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vve(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function bve(e){if(Array.isArray(e))return e}var Oy=function(t,n,r){return t+(n-t)*r},HS=function(t){var n=t.from,r=t.to;return n!==r},xve=function e(t,n,r){var i=eh(function(o,s){if(HS(s)){var a=t(s.from,s.to,s.velocity),l=gve(a,2),u=l[0],c=l[1];return on(on({},s),{},{from:u,velocity:c})}return s},n);return r<1?eh(function(o,s){return HS(s)?on(on({},s),{},{velocity:Oy(s.velocity,i[o].velocity,r),from:Oy(s.from,i[o].from,r)}):s},n):e(t,i,r-1)};const wve=function(e,t,n,r,i){var o=Yye(e,t),s=o.reduce(function(v,b){return on(on({},v),{},WS({},b,[e[b],t[b]]))},{}),a=o.reduce(function(v,b){return on(on({},v),{},WS({},b,{from:e[b],velocity:0,to:t[b]}))},{}),l=-1,u,c,f=function(){return null},h=function(){return eh(function(b,y){return y.from},a)},d=function(){return!Object.values(a).filter(HS).length},p=function(b){u||(u=b);var y=b-u,x=y/n.dt;a=xve(n,a,x),i(on(on(on({},e),t),h())),u=b,d()||(l=requestAnimationFrame(f))},m=function(b){c||(c=b);var y=(b-c)/r,x=eh(function(w,S){return Oy.apply(void 0,hM(S).concat([n(y)]))},s);if(i(on(on(on({},e),t),x)),y<1)l=requestAnimationFrame(f);else{var k=eh(function(w,S){return Oy.apply(void 0,hM(S).concat([n(1)]))},s);i(on(on(on({},e),t),k))}};return f=n.isStepper?p:m,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(l)}}};function Zu(e){"@babel/helpers - typeof";return Zu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zu(e)}var Sve=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function kve(e,t){if(e==null)return{};var n=Ove(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ove(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function Rx(e){return Eve(e)||Pve(e)||Ave(e)||Cve()}function Cve(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
337
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ave(e,t){if(e){if(typeof e=="string")return VS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return VS(e,t)}}function Pve(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Eve(e){if(Array.isArray(e))return VS(e)}function VS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ni(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pM(Object(n),!0).forEach(function(r){Df(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Df(e,t,n){return t=b5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _ve(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,b5(r.key),r)}}function jve(e,t,n){return t&&_ve(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function b5(e){var t=Mve(e,"string");return Zu(t)==="symbol"?t:String(t)}function Mve(e,t){if(Zu(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Zu(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ive(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qS(e,t)}function qS(e,t){return qS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},qS(e,t)}function Nve(e){var t=Rve();return function(){var r=Cy(e),i;if(t){var o=Cy(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return KS(this,i)}}function KS(e,t){if(t&&(Zu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return GS(e)}function GS(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rve(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Cy(e){return Cy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Cy(e)}var Qi=function(e){Ive(n,e);var t=Nve(n);function n(r,i){var o;Tve(this,n),o=t.call(this,r,i);var s=o.props,a=s.isActive,l=s.attributeName,u=s.from,c=s.to,f=s.steps,h=s.children,d=s.duration;if(o.handleStyleChange=o.handleStyleChange.bind(GS(o)),o.changeStyle=o.changeStyle.bind(GS(o)),!a||d<=0)return o.state={style:{}},typeof h=="function"&&(o.state={style:c}),KS(o);if(f&&f.length)o.state={style:f[0].style};else if(u){if(typeof h=="function")return o.state={style:u},KS(o);o.state={style:l?Df({},l,u):u}}else o.state={style:{}};return o}return jve(n,[{key:"componentDidMount",value:function(){var i=this.props,o=i.isActive,s=i.canBegin;this.mounted=!0,!(!o||!s)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var o=this.props,s=o.isActive,a=o.canBegin,l=o.attributeName,u=o.shouldReAnimate,c=o.to,f=o.from,h=this.state.style;if(a){if(!s){var d={style:l?Df({},l,c):c};this.state&&h&&(l&&h[l]!==c||!l&&h!==c)&&this.setState(d);return}if(!(zye(i.to,c)&&i.canBegin&&i.isActive)){var p=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var m=p||u?f:i.to;if(this.state&&h){var v={style:l?Df({},l,m):m};(l&&h[l]!==m||!l&&h!==m)&&this.setState(v)}this.runAnimation(ni(ni({},this.props),{},{from:m,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var o=this,s=i.from,a=i.to,l=i.duration,u=i.easing,c=i.begin,f=i.onAnimationEnd,h=i.onAnimationStart,d=wve(s,a,cve(u),l,this.changeStyle),p=function(){o.stopJSAnimation=d()};this.manager.start([h,c,p,l,f])}},{key:"runStepAnimation",value:function(i){var o=this,s=i.steps,a=i.begin,l=i.onAnimationStart,u=s[0],c=u.style,f=u.duration,h=f===void 0?0:f,d=function(m,v,b){if(b===0)return m;var y=v.duration,x=v.easing,k=x===void 0?"ease":x,w=v.style,S=v.properties,O=v.onAnimationEnd,A=b>0?s[b-1]:v,P=S||Object.keys(w);if(typeof k=="function"||k==="spring")return[].concat(Rx(m),[o.runJSAnimation.bind(o,{from:A.style,to:w,duration:y,easing:k}),y]);var M=uM(P,y,k),j=ni(ni(ni({},A.style),w),{},{transition:M});return[].concat(Rx(m),[j,y,O]).filter(Zye)};return this.manager.start([l].concat(Rx(s.reduce(d,[c,Math.max(h,a)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=Gye());var o=i.begin,s=i.duration,a=i.attributeName,l=i.to,u=i.easing,c=i.onAnimationStart,f=i.onAnimationEnd,h=i.steps,d=i.children,p=this.manager;if(this.unSubscribe=p.subscribe(this.handleStyleChange),typeof u=="function"||typeof d=="function"||u==="spring"){this.runJSAnimation(i);return}if(h.length>1){this.runStepAnimation(i);return}var m=a?Df({},a,l):l,v=uM(Object.keys(m),s,u);p.start([c,o,ni(ni({},m),{},{transition:v}),s,f])}},{key:"render",value:function(){var i=this.props,o=i.children;i.begin;var s=i.duration;i.attributeName,i.easing;var a=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=kve(i,Sve),u=C.Children.count(o),c=this.state.style;if(typeof o=="function")return o(c);if(!a||u===0||s<=0)return o;var f=function(d){var p=d.props,m=p.style,v=m===void 0?{}:m,b=p.className,y=C.cloneElement(d,ni(ni({},l),{},{style:ni(ni({},v),c),className:b}));return y};return u===1?f(C.Children.only(o)):L.createElement("div",null,C.Children.map(o,function(h){return f(h)}))}}]),n}(C.PureComponent);Qi.displayName="Animate";Qi.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Qi.propTypes={from:We.oneOfType([We.object,We.string]),to:We.oneOfType([We.object,We.string]),attributeName:We.string,duration:We.number,begin:We.number,easing:We.oneOfType([We.string,We.func]),steps:We.arrayOf(We.shape({duration:We.number.isRequired,style:We.object.isRequired,easing:We.oneOfType([We.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),We.func]),properties:We.arrayOf("string"),onAnimationEnd:We.func})),children:We.oneOfType([We.node,We.func]),isActive:We.bool,canBegin:We.bool,onAnimationEnd:We.func,shouldReAnimate:We.bool,onAnimationStart:We.func,onAnimationReStart:We.func};function QS(){return QS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},QS.apply(null,arguments)}function Dve(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function hd(e){"@babel/helpers - typeof";return hd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hd(e)}function Ay(){return Ay=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ay.apply(this,arguments)}function Lve(e,t){return zve(e)||Fve(e,t)||Bve(e,t)||$ve()}function $ve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
338
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bve(e,t){if(e){if(typeof e=="string")return mM(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mM(e,t)}}function mM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Fve(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function zve(e){if(Array.isArray(e))return e}function gM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gM(Object(n),!0).forEach(function(r){Wve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wve(e,t,n){return t=Uve(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uve(e){var t=Hve(e,"string");return hd(t)=="symbol"?t:t+""}function Hve(e,t){if(hd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(hd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var vM=function(t,n,r,i,o){var s=Math.min(Math.abs(r)/2,Math.abs(i)/2),a=i>=0?1:-1,l=r>=0?1:-1,u=i>=0&&r>=0||i<0&&r<0?1:0,c;if(s>0&&o instanceof Array){for(var f=[0,0,0,0],h=0,d=4;h<d;h++)f[h]=o[h]>s?s:o[h];c="M".concat(t,",").concat(n+a*f[0]),f[0]>0&&(c+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+l*f[0],",").concat(n)),c+="L ".concat(t+r-l*f[1],",").concat(n),f[1]>0&&(c+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`,
|
|
339
|
-
`).concat(t+r,",").concat(n+a*f[1])),c+="L ".concat(t+r,",").concat(n+i-a*f[2]),f[2]>0&&(c+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`,
|
|
340
|
-
`).concat(t+r-l*f[2],",").concat(n+i)),c+="L ".concat(t+l*f[3],",").concat(n+i),f[3]>0&&(c+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`,
|
|
341
|
-
`).concat(t,",").concat(n+i-a*f[3])),c+="Z"}else if(s>0&&o===+o&&o>0){var p=Math.min(s,o);c="M ".concat(t,",").concat(n+a*p,`
|
|
342
|
-
A `).concat(p,",").concat(p,",0,0,").concat(u,",").concat(t+l*p,",").concat(n,`
|
|
343
|
-
L `).concat(t+r-l*p,",").concat(n,`
|
|
344
|
-
A `).concat(p,",").concat(p,",0,0,").concat(u,",").concat(t+r,",").concat(n+a*p,`
|
|
345
|
-
L `).concat(t+r,",").concat(n+i-a*p,`
|
|
346
|
-
A `).concat(p,",").concat(p,",0,0,").concat(u,",").concat(t+r-l*p,",").concat(n+i,`
|
|
347
|
-
L `).concat(t+l*p,",").concat(n+i,`
|
|
348
|
-
A `).concat(p,",").concat(p,",0,0,").concat(u,",").concat(t,",").concat(n+i-a*p," Z")}else c="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return c},Vve=function(t,n){if(!t||!n)return!1;var r=t.x,i=t.y,o=n.x,s=n.y,a=n.width,l=n.height;if(Math.abs(a)>0&&Math.abs(l)>0){var u=Math.min(o,o+a),c=Math.max(o,o+a),f=Math.min(s,s+l),h=Math.max(s,s+l);return r>=u&&r<=c&&i>=f&&i<=h}return!1},qve={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},XA=function(t){var n=yM(yM({},qve),t),r=C.useRef(),i=C.useState(-1),o=Lve(i,2),s=o[0],a=o[1];C.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var k=r.current.getTotalLength();k&&a(k)}catch{}},[]);var l=n.x,u=n.y,c=n.width,f=n.height,h=n.radius,d=n.className,p=n.animationEasing,m=n.animationDuration,v=n.animationBegin,b=n.isAnimationActive,y=n.isUpdateAnimationActive;if(l!==+l||u!==+u||c!==+c||f!==+f||c===0||f===0)return null;var x=Se("recharts-rectangle",d);return y?L.createElement(Qi,{canBegin:s>0,from:{width:c,height:f,x:l,y:u},to:{width:c,height:f,x:l,y:u},duration:m,animationEasing:p,isActive:y},function(k){var w=k.width,S=k.height,O=k.x,A=k.y;return L.createElement(Qi,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:m,isActive:b,easing:p},L.createElement("path",Ay({},pe(n,!0),{className:x,d:vM(O,A,w,S,h),ref:r})))}):L.createElement("path",Ay({},pe(n,!0),{className:x,d:vM(l,u,c,f,h)}))},Kve=["points","className","baseLinePoints","connectNulls"];function tu(){return tu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tu.apply(this,arguments)}function Gve(e,t){if(e==null)return{};var n=Qve(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Qve(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function bM(e){return Jve(e)||Zve(e)||Yve(e)||Xve()}function Xve(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
349
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yve(e,t){if(e){if(typeof e=="string")return XS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return XS(e,t)}}function Zve(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Jve(e){if(Array.isArray(e))return XS(e)}function XS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var xM=function(t){return t&&t.x===+t.x&&t.y===+t.y},e0e=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){xM(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),xM(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},th=function(t,n){var r=e0e(t);n&&(r=[r.reduce(function(o,s){return[].concat(bM(o),bM(s))},[])]);var i=r.map(function(o){return o.reduce(function(s,a,l){return"".concat(s).concat(l===0?"M":"L").concat(a.x,",").concat(a.y)},"")}).join("");return r.length===1?"".concat(i,"Z"):i},t0e=function(t,n,r){var i=th(t,r);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(th(n.reverse(),r).slice(1))},n0e=function(t){var n=t.points,r=t.className,i=t.baseLinePoints,o=t.connectNulls,s=Gve(t,Kve);if(!n||!n.length)return null;var a=Se("recharts-polygon",r);if(i&&i.length){var l=s.stroke&&s.stroke!=="none",u=t0e(n,i,o);return L.createElement("g",{className:a},L.createElement("path",tu({},pe(s,!0),{fill:u.slice(-1)==="Z"?s.fill:"none",stroke:"none",d:u})),l?L.createElement("path",tu({},pe(s,!0),{fill:"none",d:th(n,o)})):null,l?L.createElement("path",tu({},pe(s,!0),{fill:"none",d:th(i,o)})):null)}var c=th(n,o);return L.createElement("path",tu({},pe(s,!0),{fill:c.slice(-1)==="Z"?s.fill:"none",className:a,d:c}))};function YS(){return YS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},YS.apply(this,arguments)}var L0=function(t){var n=t.cx,r=t.cy,i=t.r,o=t.className,s=Se("recharts-dot",o);return n===+n&&r===+r&&i===+i?C.createElement("circle",YS({},pe(t,!1),Hg(t),{className:s,cx:n,cy:r,r:i})):null};function dd(e){"@babel/helpers - typeof";return dd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dd(e)}var r0e=["x","y","top","left","width","height","className"];function ZS(){return ZS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ZS.apply(this,arguments)}function wM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function i0e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wM(Object(n),!0).forEach(function(r){o0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function o0e(e,t,n){return t=s0e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s0e(e){var t=a0e(e,"string");return dd(t)=="symbol"?t:t+""}function a0e(e,t){if(dd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(dd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function l0e(e,t){if(e==null)return{};var n=u0e(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function u0e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var c0e=function(t,n,r,i,o,s){return"M".concat(t,",").concat(o,"v").concat(i,"M").concat(s,",").concat(n,"h").concat(r)},f0e=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,o=i===void 0?0:i,s=t.top,a=s===void 0?0:s,l=t.left,u=l===void 0?0:l,c=t.width,f=c===void 0?0:c,h=t.height,d=h===void 0?0:h,p=t.className,m=l0e(t,r0e),v=i0e({x:r,y:o,top:a,left:u,width:f,height:d},m);return!ne(r)||!ne(o)||!ne(f)||!ne(d)||!ne(a)||!ne(u)?null:L.createElement("path",ZS({},pe(v,!0),{className:Se("recharts-cross",p),d:c0e(r,o,f,d,a,u)}))},h0e=M0,d0e=M4,p0e=Us;function m0e(e,t){return e&&e.length?h0e(e,p0e(t),d0e):void 0}var g0e=m0e;const y0e=ze(g0e);var v0e=M0,b0e=Us,x0e=I4;function w0e(e,t){return e&&e.length?v0e(e,b0e(t),x0e):void 0}var S0e=w0e;const k0e=ze(S0e);var O0e=["cx","cy","angle","ticks","axisLine"],C0e=["ticks","tick","angle","tickFormatter","stroke"];function Ju(e){"@babel/helpers - typeof";return Ju=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ju(e)}function nh(){return nh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nh.apply(this,arguments)}function SM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function na(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SM(Object(n),!0).forEach(function(r){$0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kM(e,t){if(e==null)return{};var n=A0e(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function A0e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function P0e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OM(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,w5(r.key),r)}}function E0e(e,t,n){return t&&OM(e.prototype,t),n&&OM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function T0e(e,t,n){return t=Py(t),_0e(e,x5()?Reflect.construct(t,n||[],Py(e).constructor):t.apply(e,n))}function _0e(e,t){if(t&&(Ju(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return j0e(e)}function j0e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function x5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(x5=function(){return!!e})()}function Py(e){return Py=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Py(e)}function M0e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&JS(e,t)}function JS(e,t){return JS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},JS(e,t)}function $0(e,t,n){return t=w5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w5(e){var t=I0e(e,"string");return Ju(t)=="symbol"?t:t+""}function I0e(e,t){if(Ju(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ju(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var B0=function(e){function t(){return P0e(this,t),T0e(this,t,arguments)}return M0e(t,e),E0e(t,[{key:"getTickValueCoord",value:function(r){var i=r.coordinate,o=this.props,s=o.angle,a=o.cx,l=o.cy;return st(a,l,i,s)}},{key:"getTickTextAnchor",value:function(){var r=this.props.orientation,i;switch(r){case"left":i="end";break;case"right":i="start";break;default:i="middle";break}return i}},{key:"getViewBox",value:function(){var r=this.props,i=r.cx,o=r.cy,s=r.angle,a=r.ticks,l=y0e(a,function(c){return c.coordinate||0}),u=k0e(a,function(c){return c.coordinate||0});return{cx:i,cy:o,startAngle:s,endAngle:s,innerRadius:u.coordinate||0,outerRadius:l.coordinate||0}}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.cx,o=r.cy,s=r.angle,a=r.ticks,l=r.axisLine,u=kM(r,O0e),c=a.reduce(function(p,m){return[Math.min(p[0],m.coordinate),Math.max(p[1],m.coordinate)]},[1/0,-1/0]),f=st(i,o,c[0],s),h=st(i,o,c[1],s),d=na(na(na({},pe(u,!1)),{},{fill:"none"},pe(l,!1)),{},{x1:f.x,y1:f.y,x2:h.x,y2:h.y});return L.createElement("line",nh({className:"recharts-polar-radius-axis-line"},d))}},{key:"renderTicks",value:function(){var r=this,i=this.props,o=i.ticks,s=i.tick,a=i.angle,l=i.tickFormatter,u=i.stroke,c=kM(i,C0e),f=this.getTickTextAnchor(),h=pe(c,!1),d=pe(s,!1),p=o.map(function(m,v){var b=r.getTickValueCoord(m),y=na(na(na(na({textAnchor:f,transform:"rotate(".concat(90-a,", ").concat(b.x,", ").concat(b.y,")")},h),{},{stroke:"none",fill:u},d),{},{index:v},b),{},{payload:m});return L.createElement($e,nh({className:Se("recharts-polar-radius-axis-tick",s5(s)),key:"tick-".concat(m.coordinate)},Za(r.props,m,v)),t.renderTickItem(s,y,l?l(m.value,v):m.value))});return L.createElement($e,{className:"recharts-polar-radius-axis-ticks"},p)}},{key:"render",value:function(){var r=this.props,i=r.ticks,o=r.axisLine,s=r.tick;return!i||!i.length?null:L.createElement($e,{className:Se("recharts-polar-radius-axis",this.props.className)},o&&this.renderAxisLine(),s&&this.renderTicks(),Yt.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,i,o){var s;return L.isValidElement(r)?s=L.cloneElement(r,i):xe(r)?s=r(i):s=L.createElement(Ja,nh({},i,{className:"recharts-polar-radius-axis-tick-value"}),o),s}}])}(C.PureComponent);$0(B0,"displayName","PolarRadiusAxis");$0(B0,"axisType","radiusAxis");$0(B0,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function ec(e){"@babel/helpers - typeof";return ec=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ec(e)}function ha(){return ha=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ha.apply(this,arguments)}function CM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ra(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CM(Object(n),!0).forEach(function(r){F0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function N0e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AM(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,k5(r.key),r)}}function R0e(e,t,n){return t&&AM(e.prototype,t),n&&AM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function D0e(e,t,n){return t=Ey(t),L0e(e,S5()?Reflect.construct(t,n||[],Ey(e).constructor):t.apply(e,n))}function L0e(e,t){if(t&&(ec(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $0e(e)}function $0e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(S5=function(){return!!e})()}function Ey(e){return Ey=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ey(e)}function B0e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ek(e,t)}function ek(e,t){return ek=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},ek(e,t)}function F0(e,t,n){return t=k5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k5(e){var t=F0e(e,"string");return ec(t)=="symbol"?t:t+""}function F0e(e,t){if(ec(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ec(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var z0e=Math.PI/180,PM=1e-5,z0=function(e){function t(){return N0e(this,t),D0e(this,t,arguments)}return B0e(t,e),R0e(t,[{key:"getTickLineCoord",value:function(r){var i=this.props,o=i.cx,s=i.cy,a=i.radius,l=i.orientation,u=i.tickSize,c=u||8,f=st(o,s,a,r.coordinate),h=st(o,s,a+(l==="inner"?-1:1)*c,r.coordinate);return{x1:f.x,y1:f.y,x2:h.x,y2:h.y}}},{key:"getTickTextAnchor",value:function(r){var i=this.props.orientation,o=Math.cos(-r.coordinate*z0e),s;return o>PM?s=i==="outer"?"start":"end":o<-PM?s=i==="outer"?"end":"start":s="middle",s}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.cx,o=r.cy,s=r.radius,a=r.axisLine,l=r.axisLineType,u=ra(ra({},pe(this.props,!1)),{},{fill:"none"},pe(a,!1));if(l==="circle")return L.createElement(L0,ha({className:"recharts-polar-angle-axis-line"},u,{cx:i,cy:o,r:s}));var c=this.props.ticks,f=c.map(function(h){return st(i,o,s,h.coordinate)});return L.createElement(n0e,ha({className:"recharts-polar-angle-axis-line"},u,{points:f}))}},{key:"renderTicks",value:function(){var r=this,i=this.props,o=i.ticks,s=i.tick,a=i.tickLine,l=i.tickFormatter,u=i.stroke,c=pe(this.props,!1),f=pe(s,!1),h=ra(ra({},c),{},{fill:"none"},pe(a,!1)),d=o.map(function(p,m){var v=r.getTickLineCoord(p),b=r.getTickTextAnchor(p),y=ra(ra(ra({textAnchor:b},c),{},{stroke:"none",fill:u},f),{},{index:m,payload:p,x:v.x2,y:v.y2});return L.createElement($e,ha({className:Se("recharts-polar-angle-axis-tick",s5(s)),key:"tick-".concat(p.coordinate)},Za(r.props,p,m)),a&&L.createElement("line",ha({className:"recharts-polar-angle-axis-tick-line"},h,v)),s&&t.renderTickItem(s,y,l?l(p.value,m):p.value))});return L.createElement($e,{className:"recharts-polar-angle-axis-ticks"},d)}},{key:"render",value:function(){var r=this.props,i=r.ticks,o=r.radius,s=r.axisLine;return o<=0||!i||!i.length?null:L.createElement($e,{className:Se("recharts-polar-angle-axis",this.props.className)},s&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,i,o){var s;return L.isValidElement(r)?s=L.cloneElement(r,i):xe(r)?s=r(i):s=L.createElement(Ja,ha({},i,{className:"recharts-polar-angle-axis-tick-value"}),o),s}}])}(C.PureComponent);F0(z0,"displayName","PolarAngleAxis");F0(z0,"axisType","angleAxis");F0(z0,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var W0e=T3,U0e=W0e(Object.getPrototypeOf,Object),H0e=U0e,V0e=Bo,q0e=H0e,K0e=Fo,G0e="[object Object]",Q0e=Function.prototype,X0e=Object.prototype,O5=Q0e.toString,Y0e=X0e.hasOwnProperty,Z0e=O5.call(Object);function J0e(e){if(!K0e(e)||V0e(e)!=G0e)return!1;var t=q0e(e);if(t===null)return!0;var n=Y0e.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&O5.call(n)==Z0e}var ebe=J0e;const tbe=ze(ebe);var nbe=Bo,rbe=Fo,ibe="[object Boolean]";function obe(e){return e===!0||e===!1||rbe(e)&&nbe(e)==ibe}var sbe=obe;const abe=ze(sbe);function pd(e){"@babel/helpers - typeof";return pd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pd(e)}function Ty(){return Ty=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ty.apply(this,arguments)}function lbe(e,t){return hbe(e)||fbe(e,t)||cbe(e,t)||ube()}function ube(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
350
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cbe(e,t){if(e){if(typeof e=="string")return EM(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return EM(e,t)}}function EM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fbe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function hbe(e){if(Array.isArray(e))return e}function TM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _M(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TM(Object(n),!0).forEach(function(r){dbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dbe(e,t,n){return t=pbe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pbe(e){var t=mbe(e,"string");return pd(t)=="symbol"?t:t+""}function mbe(e,t){if(pd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(pd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jM=function(t,n,r,i,o){var s=r-i,a;return a="M ".concat(t,",").concat(n),a+="L ".concat(t+r,",").concat(n),a+="L ".concat(t+r-s/2,",").concat(n+o),a+="L ".concat(t+r-s/2-i,",").concat(n+o),a+="L ".concat(t,",").concat(n," Z"),a},gbe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},ybe=function(t){var n=_M(_M({},gbe),t),r=C.useRef(),i=C.useState(-1),o=lbe(i,2),s=o[0],a=o[1];C.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var x=r.current.getTotalLength();x&&a(x)}catch{}},[]);var l=n.x,u=n.y,c=n.upperWidth,f=n.lowerWidth,h=n.height,d=n.className,p=n.animationEasing,m=n.animationDuration,v=n.animationBegin,b=n.isUpdateAnimationActive;if(l!==+l||u!==+u||c!==+c||f!==+f||h!==+h||c===0&&f===0||h===0)return null;var y=Se("recharts-trapezoid",d);return b?L.createElement(Qi,{canBegin:s>0,from:{upperWidth:0,lowerWidth:0,height:h,x:l,y:u},to:{upperWidth:c,lowerWidth:f,height:h,x:l,y:u},duration:m,animationEasing:p,isActive:b},function(x){var k=x.upperWidth,w=x.lowerWidth,S=x.height,O=x.x,A=x.y;return L.createElement(Qi,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:m,easing:p},L.createElement("path",Ty({},pe(n,!0),{className:y,d:jM(O,A,k,w,S),ref:r})))}):L.createElement("g",null,L.createElement("path",Ty({},pe(n,!0),{className:y,d:jM(l,u,c,f,h)})))},vbe=["option","shapeType","propTransformer","activeClassName","isActive"];function md(e){"@babel/helpers - typeof";return md=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},md(e)}function bbe(e,t){if(e==null)return{};var n=xbe(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function xbe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function MM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _y(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MM(Object(n),!0).forEach(function(r){wbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wbe(e,t,n){return t=Sbe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sbe(e){var t=kbe(e,"string");return md(t)=="symbol"?t:t+""}function kbe(e,t){if(md(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(md(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Obe(e,t){return _y(_y({},t),e)}function Cbe(e,t){return e==="symbols"}function IM(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return L.createElement(XA,n);case"trapezoid":return L.createElement(ybe,n);case"sector":return L.createElement(u5,n);case"symbols":if(Cbe(t))return L.createElement(pA,n);break;default:return null}}function Abe(e){return C.isValidElement(e)?e.props:e}function C5(e){var t=e.option,n=e.shapeType,r=e.propTransformer,i=r===void 0?Obe:r,o=e.activeClassName,s=o===void 0?"recharts-active-shape":o,a=e.isActive,l=bbe(e,vbe),u;if(C.isValidElement(t))u=C.cloneElement(t,_y(_y({},l),Abe(t)));else if(xe(t))u=t(l);else if(tbe(t)&&!abe(t)){var c=i(t,l);u=L.createElement(IM,{shapeType:n,elementProps:c})}else{var f=l;u=L.createElement(IM,{shapeType:n,elementProps:f})}return a?L.createElement($e,{className:s},u):u}function W0(e,t){return t!=null&&"trapezoids"in e.props}function U0(e,t){return t!=null&&"sectors"in e.props}function gd(e,t){return t!=null&&"points"in e.props}function Pbe(e,t){var n,r,i=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,o=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return i&&o}function Ebe(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function Tbe(e,t){var n=e.x===t.x,r=e.y===t.y,i=e.z===t.z;return n&&r&&i}function _be(e,t){var n;return W0(e,t)?n=Pbe:U0(e,t)?n=Ebe:gd(e,t)&&(n=Tbe),n}function jbe(e,t){var n;return W0(e,t)?n="trapezoids":U0(e,t)?n="sectors":gd(e,t)&&(n="points"),n}function Mbe(e,t){if(W0(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}if(U0(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}return gd(e,t)?t.payload:{}}function Ibe(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,i=jbe(n,t),o=Mbe(n,t),s=r.filter(function(l,u){var c=ip(o,l),f=n.props[i].filter(function(p){var m=_be(n,t);return m(p,t)}),h=n.props[i].indexOf(f[f.length-1]),d=u===h;return c&&d}),a=r.indexOf(s[s.length-1]);return a}var Ym;function tc(e){"@babel/helpers - typeof";return tc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tc(e)}function nu(){return nu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nu.apply(this,arguments)}function NM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function tt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NM(Object(n),!0).forEach(function(r){$r(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nbe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function RM(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,P5(r.key),r)}}function Rbe(e,t,n){return t&&RM(e.prototype,t),n&&RM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Dbe(e,t,n){return t=jy(t),Lbe(e,A5()?Reflect.construct(t,n||[],jy(e).constructor):t.apply(e,n))}function Lbe(e,t){if(t&&(tc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $be(e)}function $be(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function A5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(A5=function(){return!!e})()}function jy(e){return jy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},jy(e)}function Bbe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tk(e,t)}function tk(e,t){return tk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},tk(e,t)}function $r(e,t,n){return t=P5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P5(e){var t=Fbe(e,"string");return tc(t)=="symbol"?t:t+""}function Fbe(e,t){if(tc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(tc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Wo=function(e){function t(n){var r;return Nbe(this,t),r=Dbe(this,t,[n]),$r(r,"pieRef",null),$r(r,"sectorRefs",[]),$r(r,"id",Rc("recharts-pie-")),$r(r,"handleAnimationEnd",function(){var i=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),xe(i)&&i()}),$r(r,"handleAnimationStart",function(){var i=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),xe(i)&&i()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return Bbe(t,e),Rbe(t,[{key:"isActiveIndex",value:function(r){var i=this.props.activeIndex;return Array.isArray(i)?i.indexOf(r)!==-1:r===i}},{key:"hasActiveIndex",value:function(){var r=this.props.activeIndex;return Array.isArray(r)?r.length!==0:r||r===0}},{key:"renderLabels",value:function(r){var i=this.props.isAnimationActive;if(i&&!this.state.isAnimationFinished)return null;var o=this.props,s=o.label,a=o.labelLine,l=o.dataKey,u=o.valueKey,c=pe(this.props,!1),f=pe(s,!1),h=pe(a,!1),d=s&&s.offsetRadius||20,p=r.map(function(m,v){var b=(m.startAngle+m.endAngle)/2,y=st(m.cx,m.cy,m.outerRadius+d,b),x=tt(tt(tt(tt({},c),m),{},{stroke:"none"},f),{},{index:v,textAnchor:t.getTextAnchor(y.x,m.cx)},y),k=tt(tt(tt(tt({},c),m),{},{fill:"none",stroke:m.fill},h),{},{index:v,points:[st(m.cx,m.cy,m.outerRadius,b),y]}),w=l;return we(l)&&we(u)?w="value":we(l)&&(w=u),L.createElement($e,{key:"label-".concat(m.startAngle,"-").concat(m.endAngle,"-").concat(m.midAngle,"-").concat(v)},a&&t.renderLabelLineItem(a,k,"line"),t.renderLabelItem(s,x,Ut(m,w)))});return L.createElement($e,{className:"recharts-pie-labels"},p)}},{key:"renderSectorsStatically",value:function(r){var i=this,o=this.props,s=o.activeShape,a=o.blendStroke,l=o.inactiveShape;return r.map(function(u,c){if(u?.startAngle===0&&u?.endAngle===0&&r.length!==1)return null;var f=i.isActiveIndex(c),h=l&&i.hasActiveIndex()?l:null,d=f?s:h,p=tt(tt({},u),{},{stroke:a?u.fill:u.stroke,tabIndex:-1});return L.createElement($e,nu({ref:function(v){v&&!i.sectorRefs.includes(v)&&i.sectorRefs.push(v)},tabIndex:-1,className:"recharts-pie-sector"},Za(i.props,u,c),{key:"sector-".concat(u?.startAngle,"-").concat(u?.endAngle,"-").concat(u.midAngle,"-").concat(c)}),L.createElement(C5,nu({option:d,isActive:f,shapeType:"sector"},p)))})}},{key:"renderSectorsWithAnimation",value:function(){var r=this,i=this.props,o=i.sectors,s=i.isAnimationActive,a=i.animationBegin,l=i.animationDuration,u=i.animationEasing,c=i.animationId,f=this.state,h=f.prevSectors,d=f.prevIsAnimationActive;return L.createElement(Qi,{begin:a,duration:l,isActive:s,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(c,"-").concat(d),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(p){var m=p.t,v=[],b=o&&o[0],y=b.startAngle;return o.forEach(function(x,k){var w=h&&h[k],S=k>0?Or(x,"paddingAngle",0):0;if(w){var O=yr(w.endAngle-w.startAngle,x.endAngle-x.startAngle),A=tt(tt({},x),{},{startAngle:y+S,endAngle:y+O(m)+S});v.push(A),y=A.endAngle}else{var P=x.endAngle,M=x.startAngle,j=yr(0,P-M),E=j(m),D=tt(tt({},x),{},{startAngle:y+S,endAngle:y+E+S});v.push(D),y=D.endAngle}}),L.createElement($e,null,r.renderSectorsStatically(v))})}},{key:"attachKeyboardHandlers",value:function(r){var i=this;r.onkeydown=function(o){if(!o.altKey)switch(o.key){case"ArrowLeft":{var s=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"ArrowRight":{var a=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[a].focus(),i.setState({sectorToFocus:a});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,i=r.sectors,o=r.isAnimationActive,s=this.state.prevSectors;return o&&i&&i.length&&(!s||!ip(s,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,i=this.props,o=i.hide,s=i.sectors,a=i.className,l=i.label,u=i.cx,c=i.cy,f=i.innerRadius,h=i.outerRadius,d=i.isAnimationActive,p=this.state.isAnimationFinished;if(o||!s||!s.length||!ne(u)||!ne(c)||!ne(f)||!ne(h))return null;var m=Se("recharts-pie",a);return L.createElement($e,{tabIndex:this.props.rootTabIndex,className:m,ref:function(b){r.pieRef=b}},this.renderSectors(),l&&this.renderLabels(s),Yt.renderCallByParent(this.props,null,!1),(!d||p)&&ko.renderCallByParent(this.props,s,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return i.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:r.sectors!==i.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,i){return r>i?"start":r<i?"end":"middle"}},{key:"renderLabelLineItem",value:function(r,i,o){if(L.isValidElement(r))return L.cloneElement(r,i);if(xe(r))return r(i);var s=Se("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return L.createElement(wy,nu({},i,{key:o,type:"linear",className:s}))}},{key:"renderLabelItem",value:function(r,i,o){if(L.isValidElement(r))return L.cloneElement(r,i);var s=o;if(xe(r)&&(s=r(i),L.isValidElement(s)))return s;var a=Se("recharts-pie-label-text",typeof r!="boolean"&&!xe(r)?r.className:"");return L.createElement(Ja,nu({},i,{alignmentBaseline:"middle",className:a}),s)}}])}(C.PureComponent);Ym=Wo;$r(Wo,"displayName","Pie");$r(Wo,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!dl.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});$r(Wo,"parseDeltaAngle",function(e,t){var n=Mn(t-e),r=Math.min(Math.abs(t-e),360);return n*r});$r(Wo,"getRealPieData",function(e){var t=e.data,n=e.children,r=pe(e,!1),i=Cr(n,Ku);return t&&t.length?t.map(function(o,s){return tt(tt(tt({payload:o},r),o),i&&i[s]&&i[s].props)}):i&&i.length?i.map(function(o){return tt(tt({},r),o.props)}):[]});$r(Wo,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,i=t.width,o=t.height,s=o5(i,o),a=r+In(e.cx,i,i/2),l=n+In(e.cy,o,o/2),u=In(e.innerRadius,s,0),c=In(e.outerRadius,s,s*.8),f=e.maxRadius||Math.sqrt(i*i+o*o)/2;return{cx:a,cy:l,innerRadius:u,outerRadius:c,maxRadius:f}});$r(Wo,"getComposedData",function(e){var t=e.item,n=e.offset,r=t.type.defaultProps!==void 0?tt(tt({},t.type.defaultProps),t.props):t.props,i=Ym.getRealPieData(r);if(!i||!i.length)return null;var o=r.cornerRadius,s=r.startAngle,a=r.endAngle,l=r.paddingAngle,u=r.dataKey,c=r.nameKey,f=r.valueKey,h=r.tooltipType,d=Math.abs(r.minAngle),p=Ym.parseCoordinateOfPie(r,n),m=Ym.parseDeltaAngle(s,a),v=Math.abs(m),b=u;we(u)&&we(f)?(wo(!1,`Use "dataKey" to specify the value of pie,
|
|
351
|
-
the props "valueKey" will be deprecated in 1.1.0`),b="value"):we(u)&&(wo(!1,`Use "dataKey" to specify the value of pie,
|
|
352
|
-
the props "valueKey" will be deprecated in 1.1.0`),b=f);var y=i.filter(function(A){return Ut(A,b,0)!==0}).length,x=(v>=360?y:y-1)*l,k=v-y*d-x,w=i.reduce(function(A,P){var M=Ut(P,b,0);return A+(ne(M)?M:0)},0),S;if(w>0){var O;S=i.map(function(A,P){var M=Ut(A,b,0),j=Ut(A,c,P),E=(ne(M)?M:0)/w,D;P?D=O.endAngle+Mn(m)*l*(M!==0?1:0):D=s;var R=D+Mn(m)*((M!==0?d:0)+E*k),N=(D+R)/2,B=(p.innerRadius+p.outerRadius)/2,F=[{name:j,value:M,payload:A,dataKey:b,type:h}],$=st(p.cx,p.cy,B,N);return O=tt(tt(tt({percent:E,cornerRadius:o,name:j,tooltipPayload:F,midAngle:N,middleRadius:B,tooltipPosition:$},A),p),{},{value:Ut(A,b),startAngle:D,endAngle:R,payload:A,paddingAngle:Mn(m)*l}),O})}return tt(tt({},p),{},{sectors:S,data:i})});var zbe=Math.ceil,Wbe=Math.max;function Ube(e,t,n,r){for(var i=-1,o=Wbe(zbe((t-e)/(n||1)),0),s=Array(o);o--;)s[r?o:++i]=e,e+=n;return s}var Hbe=Ube,Vbe=K3,DM=1/0,qbe=17976931348623157e292;function Kbe(e){if(!e)return e===0?e:0;if(e=Vbe(e),e===DM||e===-DM){var t=e<0?-1:1;return t*qbe}return e===e?e:0}var Gbe=Kbe,Qbe=Hbe,Xbe=C0,Dx=Gbe;function Ybe(e){return function(t,n,r){return r&&typeof r!="number"&&Xbe(t,n,r)&&(n=r=void 0),t=Dx(t),n===void 0?(n=t,t=0):n=Dx(n),r=r===void 0?t<n?1:-1:Dx(r),Qbe(t,n,r,e)}}var Zbe=Ybe,Jbe=Zbe,exe=Jbe(),txe=exe;const My=ze(txe);function yd(e){"@babel/helpers - typeof";return yd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yd(e)}function LM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $M(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LM(Object(n),!0).forEach(function(r){E5(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function E5(e,t,n){return t=nxe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nxe(e){var t=rxe(e,"string");return yd(t)=="symbol"?t:t+""}function rxe(e,t){if(yd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(yd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ixe=["Webkit","Moz","O","ms"],oxe=function(t,n){var r=t.replace(/(\w)/,function(o){return o.toUpperCase()}),i=ixe.reduce(function(o,s){return $M($M({},o),{},E5({},s+r,n))},{});return i[t]=n,i};function nc(e){"@babel/helpers - typeof";return nc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nc(e)}function Iy(){return Iy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Iy.apply(this,arguments)}function BM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Lx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BM(Object(n),!0).forEach(function(r){hr(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sxe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FM(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_5(r.key),r)}}function axe(e,t,n){return t&&FM(e.prototype,t),n&&FM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function lxe(e,t,n){return t=Ny(t),uxe(e,T5()?Reflect.construct(t,n||[],Ny(e).constructor):t.apply(e,n))}function uxe(e,t){if(t&&(nc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cxe(e)}function cxe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function T5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(T5=function(){return!!e})()}function Ny(e){return Ny=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ny(e)}function fxe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&nk(e,t)}function nk(e,t){return nk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},nk(e,t)}function hr(e,t,n){return t=_5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _5(e){var t=hxe(e,"string");return nc(t)=="symbol"?t:t+""}function hxe(e,t){if(nc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(nc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var dxe=function(t){var n=t.data,r=t.startIndex,i=t.endIndex,o=t.x,s=t.width,a=t.travellerWidth;if(!n||!n.length)return{};var l=n.length,u=Zf().domain(My(0,l)).range([o,o+s-a]),c=u.domain().map(function(f){return u(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(r),endX:u(i),scale:u,scaleValues:c}},zM=function(t){return t.changedTouches&&!!t.changedTouches.length},rc=function(e){function t(n){var r;return sxe(this,t),r=lxe(this,t,[n]),hr(r,"handleDrag",function(i){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(i):r.state.isSlideMoving&&r.handleSlideDrag(i)}),hr(r,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&r.handleDrag(i.changedTouches[0])}),hr(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,o=i.endIndex,s=i.onDragEnd,a=i.startIndex;s?.({endIndex:o,startIndex:a})}),r.detachDragEndListener()}),hr(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),hr(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),hr(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),hr(r,"handleSlideDragStart",function(i){var o=zM(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return fxe(t,e),axe(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,o=r.endX,s=this.state.scaleValues,a=this.props,l=a.gap,u=a.data,c=u.length-1,f=Math.min(i,o),h=Math.max(i,o),d=t.getIndexInRange(s,f),p=t.getIndexInRange(s,h);return{startIndex:d-d%l,endIndex:p===c?c:p-p%l}}},{key:"getTextOfTick",value:function(r){var i=this.props,o=i.data,s=i.tickFormatter,a=i.dataKey,l=Ut(o[r],a,r);return xe(s)?s(l,r):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,o=i.slideMoveStartX,s=i.startX,a=i.endX,l=this.props,u=l.x,c=l.width,f=l.travellerWidth,h=l.startIndex,d=l.endIndex,p=l.onChange,m=r.pageX-o;m>0?m=Math.min(m,u+c-f-a,u+c-f-s):m<0&&(m=Math.max(m,u-s,u-a));var v=this.getIndex({startX:s+m,endX:a+m});(v.startIndex!==h||v.endIndex!==d)&&p&&p(v),this.setState({startX:s+m,endX:a+m,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var o=zM(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,o=i.brushMoveStartX,s=i.movingTravellerId,a=i.endX,l=i.startX,u=this.state[s],c=this.props,f=c.x,h=c.width,d=c.travellerWidth,p=c.onChange,m=c.gap,v=c.data,b={startX:this.state.startX,endX:this.state.endX},y=r.pageX-o;y>0?y=Math.min(y,f+h-d-u):y<0&&(y=Math.max(y,f-u)),b[s]=u+y;var x=this.getIndex(b),k=x.startIndex,w=x.endIndex,S=function(){var A=v.length-1;return s==="startX"&&(a>l?k%m===0:w%m===0)||a<l&&w===A||s==="endX"&&(a>l?w%m===0:k%m===0)||a>l&&w===A};this.setState(hr(hr({},s,u+y),"brushMoveStartX",r.pageX),function(){p&&S()&&p(x)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var o=this,s=this.state,a=s.scaleValues,l=s.startX,u=s.endX,c=this.state[i],f=a.indexOf(c);if(f!==-1){var h=f+r;if(!(h===-1||h>=a.length)){var d=a[h];i==="startX"&&d>=u||i==="endX"&&d<=l||this.setState(hr({},i,d),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,o=r.y,s=r.width,a=r.height,l=r.fill,u=r.stroke;return L.createElement("rect",{stroke:u,fill:l,x:i,y:o,width:s,height:a})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,o=r.y,s=r.width,a=r.height,l=r.data,u=r.children,c=r.padding,f=C.Children.only(u);return f?L.cloneElement(f,{x:i,y:o,width:s,height:a,margin:c,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(r,i){var o,s,a=this,l=this.props,u=l.y,c=l.travellerWidth,f=l.height,h=l.traveller,d=l.ariaLabel,p=l.data,m=l.startIndex,v=l.endIndex,b=Math.max(r,this.props.x),y=Lx(Lx({},pe(this.props,!1)),{},{x:b,y:u,width:c,height:f}),x=d||"Min value: ".concat((o=p[m])===null||o===void 0?void 0:o.name,", Max value: ").concat((s=p[v])===null||s===void 0?void 0:s.name);return L.createElement($e,{tabIndex:0,role:"slider","aria-label":x,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(w){["ArrowLeft","ArrowRight"].includes(w.key)&&(w.preventDefault(),w.stopPropagation(),a.handleTravellerMoveKeyboard(w.key==="ArrowRight"?1:-1,i))},onFocus:function(){a.setState({isTravellerFocused:!0})},onBlur:function(){a.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,y))}},{key:"renderSlide",value:function(r,i){var o=this.props,s=o.y,a=o.height,l=o.stroke,u=o.travellerWidth,c=Math.min(r,i)+u,f=Math.max(Math.abs(i-r)-u,0);return L.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:c,y:s,width:f,height:a})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,o=r.endIndex,s=r.y,a=r.height,l=r.travellerWidth,u=r.stroke,c=this.state,f=c.startX,h=c.endX,d=5,p={pointerEvents:"none",fill:u};return L.createElement($e,{className:"recharts-brush-texts"},L.createElement(Ja,Iy({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-d,y:s+a/2},p),this.getTextOfTick(i)),L.createElement(Ja,Iy({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+l+d,y:s+a/2},p),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,i=r.data,o=r.className,s=r.children,a=r.x,l=r.y,u=r.width,c=r.height,f=r.alwaysShowText,h=this.state,d=h.startX,p=h.endX,m=h.isTextActive,v=h.isSlideMoving,b=h.isTravellerMoving,y=h.isTravellerFocused;if(!i||!i.length||!ne(a)||!ne(l)||!ne(u)||!ne(c)||u<=0||c<=0)return null;var x=Se("recharts-brush",o),k=L.Children.count(s)===1,w=oxe("userSelect","none");return L.createElement($e,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:w},this.renderBackground(),k&&this.renderPanorama(),this.renderSlide(d,p),this.renderTravellerLayer(d,"startX"),this.renderTravellerLayer(p,"endX"),(m||v||b||y||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,o=r.y,s=r.width,a=r.height,l=r.stroke,u=Math.floor(o+a/2)-1;return L.createElement(L.Fragment,null,L.createElement("rect",{x:i,y:o,width:s,height:a,fill:l,stroke:"none"}),L.createElement("line",{x1:i+1,y1:u,x2:i+s-1,y2:u,fill:"none",stroke:"#fff"}),L.createElement("line",{x1:i+1,y1:u+2,x2:i+s-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var o;return L.isValidElement(r)?o=L.cloneElement(r,i):xe(r)?o=r(i):o=t.renderDefaultTraveller(i),o}},{key:"getDerivedStateFromProps",value:function(r,i){var o=r.data,s=r.width,a=r.x,l=r.travellerWidth,u=r.updateId,c=r.startIndex,f=r.endIndex;if(o!==i.prevData||u!==i.prevUpdateId)return Lx({prevData:o,prevTravellerWidth:l,prevUpdateId:u,prevX:a,prevWidth:s},o&&o.length?dxe({data:o,width:s,x:a,travellerWidth:l,startIndex:c,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(s!==i.prevWidth||a!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([a,a+s-l]);var h=i.scale.domain().map(function(d){return i.scale(d)});return{prevData:o,prevTravellerWidth:l,prevUpdateId:u,prevX:a,prevWidth:s,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(r,i){for(var o=r.length,s=0,a=o-1;a-s>1;){var l=Math.floor((s+a)/2);r[l]>i?a=l:s=l}return i>=r[a]?a:s}}])}(C.PureComponent);hr(rc,"displayName","Brush");hr(rc,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var pxe=SA;function mxe(e,t){var n;return pxe(e,function(r,i,o){return n=t(r,i,o),!n}),!!n}var gxe=mxe,yxe=w3,vxe=Us,bxe=gxe,xxe=rr,wxe=C0;function Sxe(e,t,n){var r=xxe(e)?yxe:bxe;return n&&wxe(e,t,n)&&(t=void 0),r(e,vxe(t))}var kxe=Sxe;const Oxe=ze(kxe);var Hi=function(t,n){var r=t.alwaysShow,i=t.ifOverflow;return r&&(i="extendDomain"),i===n},WM=W3;function Cxe(e,t,n){t=="__proto__"&&WM?WM(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Axe=Cxe,Pxe=Axe,Exe=F3,Txe=Us;function _xe(e,t){var n={};return t=Txe(t),Exe(e,function(r,i,o){Pxe(n,i,t(r,i,o))}),n}var jxe=_xe;const Mxe=ze(jxe);function Ixe(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}var Nxe=Ixe,Rxe=SA;function Dxe(e,t){var n=!0;return Rxe(e,function(r,i,o){return n=!!t(r,i,o),n}),n}var Lxe=Dxe,$xe=Nxe,Bxe=Lxe,Fxe=Us,zxe=rr,Wxe=C0;function Uxe(e,t,n){var r=zxe(e)?$xe:Bxe;return n&&Wxe(e,t,n)&&(t=void 0),r(e,Fxe(t))}var Hxe=Uxe;const Vxe=ze(Hxe);var qxe=["x","y"];function vd(e){"@babel/helpers - typeof";return vd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vd(e)}function rk(){return rk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rk.apply(this,arguments)}function UM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UM(Object(n),!0).forEach(function(r){Kxe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kxe(e,t,n){return t=Gxe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gxe(e){var t=Qxe(e,"string");return vd(t)=="symbol"?t:t+""}function Qxe(e,t){if(vd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(vd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xxe(e,t){if(e==null)return{};var n=Yxe(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Yxe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Zxe(e,t){var n=e.x,r=e.y,i=Xxe(e,qxe),o="".concat(n),s=parseInt(o,10),a="".concat(r),l=parseInt(a,10),u="".concat(t.height||i.height),c=parseInt(u,10),f="".concat(t.width||i.width),h=parseInt(f,10);return xf(xf(xf(xf(xf({},t),i),s?{x:s}:{}),l?{y:l}:{}),{},{height:c,width:h,name:t.name,radius:t.radius})}function HM(e){return L.createElement(C5,rk({shapeType:"rectangle",propTransformer:Zxe,activeClassName:"recharts-active-bar"},e))}var Jxe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof t=="number")return t;var o=ne(r)||gee(r);return o?t(r,i):(o||tl(),n)}},e1e=["value","background"],j5;function ic(e){"@babel/helpers - typeof";return ic=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ic(e)}function t1e(e,t){if(e==null)return{};var n=n1e(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function n1e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Ry(){return Ry=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ry.apply(this,arguments)}function VM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function It(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VM(Object(n),!0).forEach(function(r){ls(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function r1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qM(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,I5(r.key),r)}}function i1e(e,t,n){return t&&qM(e.prototype,t),n&&qM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function o1e(e,t,n){return t=Dy(t),s1e(e,M5()?Reflect.construct(t,n||[],Dy(e).constructor):t.apply(e,n))}function s1e(e,t){if(t&&(ic(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return a1e(e)}function a1e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function M5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(M5=function(){return!!e})()}function Dy(e){return Dy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Dy(e)}function l1e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ik(e,t)}function ik(e,t){return ik=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},ik(e,t)}function ls(e,t,n){return t=I5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I5(e){var t=u1e(e,"string");return ic(t)=="symbol"?t:t+""}function u1e(e,t){if(ic(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ic(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var yl=function(e){function t(){var n;r1e(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=o1e(this,t,[].concat(i)),ls(n,"state",{isAnimationFinished:!1}),ls(n,"id",Rc("recharts-bar-")),ls(n,"handleAnimationEnd",function(){var s=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),s&&s()}),ls(n,"handleAnimationStart",function(){var s=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),s&&s()}),n}return l1e(t,e),i1e(t,[{key:"renderRectanglesStatically",value:function(r){var i=this,o=this.props,s=o.shape,a=o.dataKey,l=o.activeIndex,u=o.activeBar,c=pe(this.props,!1);return r&&r.map(function(f,h){var d=h===l,p=d?u:s,m=It(It(It({},c),f),{},{isActive:d,option:p,index:h,dataKey:a,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return L.createElement($e,Ry({className:"recharts-bar-rectangle"},Za(i.props,f,h),{key:"rectangle-".concat(f?.x,"-").concat(f?.y,"-").concat(f?.value,"-").concat(h)}),L.createElement(HM,m))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,i=this.props,o=i.data,s=i.layout,a=i.isAnimationActive,l=i.animationBegin,u=i.animationDuration,c=i.animationEasing,f=i.animationId,h=this.state.prevData;return L.createElement(Qi,{begin:l,duration:u,isActive:a,easing:c,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(d){var p=d.t,m=o.map(function(v,b){var y=h&&h[b];if(y){var x=yr(y.x,v.x),k=yr(y.y,v.y),w=yr(y.width,v.width),S=yr(y.height,v.height);return It(It({},v),{},{x:x(p),y:k(p),width:w(p),height:S(p)})}if(s==="horizontal"){var O=yr(0,v.height),A=O(p);return It(It({},v),{},{y:v.y+v.height-A,height:A})}var P=yr(0,v.width),M=P(p);return It(It({},v),{},{width:M})});return L.createElement($e,null,r.renderRectanglesStatically(m))})}},{key:"renderRectangles",value:function(){var r=this.props,i=r.data,o=r.isAnimationActive,s=this.state.prevData;return o&&i&&i.length&&(!s||!ip(s,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var r=this,i=this.props,o=i.data,s=i.dataKey,a=i.activeIndex,l=pe(this.props.background,!1);return o.map(function(u,c){u.value;var f=u.background,h=t1e(u,e1e);if(!f)return null;var d=It(It(It(It(It({},h),{},{fill:"#eee"},f),l),Za(r.props,u,c)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:s,index:c,className:"recharts-bar-background-rectangle"});return L.createElement(HM,Ry({key:"background-bar-".concat(c),option:r.props.background,isActive:c===a},d))})}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,s=o.data,a=o.xAxis,l=o.yAxis,u=o.layout,c=o.children,f=Cr(c,op);if(!f)return null;var h=u==="vertical"?s[0].height/2:s[0].width/2,d=function(v,b){var y=Array.isArray(v.value)?v.value[1]:v.value;return{x:v.x,y:v.y,value:y,errorVal:Ut(v,b)}},p={clipPath:r?"url(#clipPath-".concat(i,")"):null};return L.createElement($e,p,f.map(function(m){return L.cloneElement(m,{key:"error-bar-".concat(i,"-").concat(m.props.dataKey),data:s,xAxis:a,yAxis:l,layout:u,offset:h,dataPointFormatter:d})}))}},{key:"render",value:function(){var r=this.props,i=r.hide,o=r.data,s=r.className,a=r.xAxis,l=r.yAxis,u=r.left,c=r.top,f=r.width,h=r.height,d=r.isAnimationActive,p=r.background,m=r.id;if(i||!o||!o.length)return null;var v=this.state.isAnimationFinished,b=Se("recharts-bar",s),y=a&&a.allowDataOverflow,x=l&&l.allowDataOverflow,k=y||x,w=we(m)?this.id:m;return L.createElement($e,{className:b},y||x?L.createElement("defs",null,L.createElement("clipPath",{id:"clipPath-".concat(w)},L.createElement("rect",{x:y?u:u-f/2,y:x?c:c-h/2,width:y?f:f*2,height:x?h:h*2}))):null,L.createElement($e,{className:"recharts-bar-rectangles",clipPath:k?"url(#clipPath-".concat(w,")"):null},p?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(k,w),(!d||v)&&ko.renderCallByParent(this.props,o))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:i.curData}:r.data!==i.curData?{curData:r.data}:null}}])}(C.PureComponent);j5=yl;ls(yl,"displayName","Bar");ls(yl,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!dl.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});ls(yl,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,i=e.bandSize,o=e.xAxis,s=e.yAxis,a=e.xAxisTicks,l=e.yAxisTicks,u=e.stackedData,c=e.dataStartIndex,f=e.displayedData,h=e.offset,d=Dme(r,n);if(!d)return null;var p=t.layout,m=n.type.defaultProps,v=m!==void 0?It(It({},m),n.props):n.props,b=v.dataKey,y=v.children,x=v.minPointSize,k=p==="horizontal"?s:o,w=u?k.scale.domain():null,S=Ume({numericAxis:k}),O=Cr(y,Ku),A=f.map(function(P,M){var j,E,D,R,N,B;u?j=Lme(u[c+M],w):(j=Ut(P,b),Array.isArray(j)||(j=[S,j]));var F=Jxe(x,j5.defaultProps.minPointSize)(j[1],M);if(p==="horizontal"){var $,z=[s.scale(j[0]),s.scale(j[1])],T=z[0],q=z[1];E=$j({axis:o,ticks:a,bandSize:i,offset:d.offset,entry:P,index:M}),D=($=q??T)!==null&&$!==void 0?$:void 0,R=d.size;var I=T-q;if(N=Number.isNaN(I)?0:I,B={x:E,y:s.y,width:R,height:s.height},Math.abs(F)>0&&Math.abs(N)<Math.abs(F)){var _=Mn(N||F)*(Math.abs(F)-Math.abs(N));D-=_,N+=_}}else{var K=[o.scale(j[0]),o.scale(j[1])],Q=K[0],te=K[1];if(E=Q,D=$j({axis:s,ticks:l,bandSize:i,offset:d.offset,entry:P,index:M}),R=te-Q,N=d.size,B={x:o.x,y:D,width:o.width,height:N},Math.abs(F)>0&&Math.abs(R)<Math.abs(F)){var he=Mn(R||F)*(Math.abs(F)-Math.abs(R));R+=he}}return It(It(It({},P),{},{x:E,y:D,width:R,height:N,value:u?j:j[1],payload:P,background:B},O&&O[M]&&O[M].props),{},{tooltipPayload:[r5(n,P)],tooltipPosition:{x:E+R/2,y:D+N/2}})});return It({data:A,layout:p},h)});function bd(e){"@babel/helpers - typeof";return bd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bd(e)}function c1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KM(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,N5(r.key),r)}}function f1e(e,t,n){return t&&KM(e.prototype,t),n&&KM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function GM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function si(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GM(Object(n),!0).forEach(function(r){H0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function H0(e,t,n){return t=N5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N5(e){var t=h1e(e,"string");return bd(t)=="symbol"?t:t+""}function h1e(e,t){if(bd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(bd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var R5=function(t,n,r,i,o){var s=t.width,a=t.height,l=t.layout,u=t.children,c=Object.keys(n),f={left:r.left,leftMirror:r.left,right:s-r.right,rightMirror:s-r.right,top:r.top,topMirror:r.top,bottom:a-r.bottom,bottomMirror:a-r.bottom},h=!!pr(u,yl);return c.reduce(function(d,p){var m=n[p],v=m.orientation,b=m.domain,y=m.padding,x=y===void 0?{}:y,k=m.mirror,w=m.reversed,S="".concat(v).concat(k?"Mirror":""),O,A,P,M,j;if(m.type==="number"&&(m.padding==="gap"||m.padding==="no-gap")){var E=b[1]-b[0],D=1/0,R=m.categoricalDomain.sort(bee);if(R.forEach(function(K,Q){Q>0&&(D=Math.min((K||0)-(R[Q-1]||0),D))}),Number.isFinite(D)){var N=D/E,B=m.layout==="vertical"?r.height:r.width;if(m.padding==="gap"&&(O=N*B/2),m.padding==="no-gap"){var F=In(t.barCategoryGap,N*B),$=N*B/2;O=$-F-($-F)/B*F}}}i==="xAxis"?A=[r.left+(x.left||0)+(O||0),r.left+r.width-(x.right||0)-(O||0)]:i==="yAxis"?A=l==="horizontal"?[r.top+r.height-(x.bottom||0),r.top+(x.top||0)]:[r.top+(x.top||0)+(O||0),r.top+r.height-(x.bottom||0)-(O||0)]:A=m.range,w&&(A=[A[1],A[0]]);var z=J4(m,o,h),T=z.scale,q=z.realScaleType;T.domain(b).range(A),e5(T);var I=t5(T,si(si({},m),{},{realScaleType:q}));i==="xAxis"?(j=v==="top"&&!k||v==="bottom"&&k,P=r.left,M=f[S]-j*m.height):i==="yAxis"&&(j=v==="left"&&!k||v==="right"&&k,P=f[S]-j*m.width,M=r.top);var _=si(si(si({},m),I),{},{realScaleType:q,x:P,y:M,scale:T,width:i==="xAxis"?r.width:m.width,height:i==="yAxis"?r.height:m.height});return _.bandSize=vy(_,I),!m.hide&&i==="xAxis"?f[S]+=(j?-1:1)*_.height:m.hide||(f[S]+=(j?-1:1)*_.width),si(si({},d),{},H0({},p,_))},{})},D5=function(t,n){var r=t.x,i=t.y,o=n.x,s=n.y;return{x:Math.min(r,o),y:Math.min(i,s),width:Math.abs(o-r),height:Math.abs(s-i)}},d1e=function(t){var n=t.x1,r=t.y1,i=t.x2,o=t.y2;return D5({x:n,y:r},{x:i,y:o})},L5=function(){function e(t){c1e(this,e),this.scale=t}return f1e(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,o=r.position;if(n!==void 0){if(o)switch(o){case"start":return this.scale(n);case"middle":{var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+s}case"end":{var a=this.bandwidth?this.bandwidth():0;return this.scale(n)+a}default:return this.scale(n)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],o=r[r.length-1];return i<=o?n>=i&&n<=o:n>=o&&n<=i}}],[{key:"create",value:function(n){return new e(n)}}])}();H0(L5,"EPS",1e-4);var YA=function(t){var n=Object.keys(t).reduce(function(r,i){return si(si({},r),{},H0({},i,L5.create(t[i])))},{});return si(si({},n),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.bandAware,a=o.position;return Mxe(i,function(l,u){return n[u].apply(l,{bandAware:s,position:a})})},isInRange:function(i){return Vxe(i,function(o,s){return n[s].isInRange(o)})}})};function p1e(e){return(e%180+180)%180}var m1e=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=p1e(i),s=o*Math.PI/180,a=Math.atan(r/n),l=s>a&&s<Math.PI-a?r/Math.sin(s):n/Math.cos(s);return Math.abs(l)},g1e=SJ(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),$5=C.createContext(void 0),B5=C.createContext(void 0),F5=C.createContext(void 0),y1e=C.createContext({}),z5=C.createContext(void 0),W5=C.createContext(0),U5=C.createContext(0),QM=function(t){var n=t.state,r=n.xAxisMap,i=n.yAxisMap,o=n.offset,s=t.clipPathId,a=t.children,l=t.width,u=t.height,c=g1e(o);return L.createElement($5.Provider,{value:r},L.createElement(B5.Provider,{value:i},L.createElement(y1e.Provider,{value:o},L.createElement(F5.Provider,{value:c},L.createElement(z5.Provider,{value:s},L.createElement(W5.Provider,{value:u},L.createElement(U5.Provider,{value:l},a)))))))},v1e=function(){return C.useContext(z5)},H5=function(t){var n=C.useContext($5);n==null&&tl();var r=n[t];return r==null&&tl(),r},V5=function(t){var n=C.useContext(B5);n==null&&tl();var r=n[t];return r==null&&tl(),r},b1e=function(){var t=C.useContext(F5);return t},q5=function(){return C.useContext(U5)},K5=function(){return C.useContext(W5)};function oc(e){"@babel/helpers - typeof";return oc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oc(e)}function x1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function w1e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Q5(r.key),r)}}function S1e(e,t,n){return t&&w1e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function k1e(e,t,n){return t=Ly(t),O1e(e,G5()?Reflect.construct(t,n||[],Ly(e).constructor):t.apply(e,n))}function O1e(e,t){if(t&&(oc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return C1e(e)}function C1e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function G5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(G5=function(){return!!e})()}function Ly(e){return Ly=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ly(e)}function A1e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ok(e,t)}function ok(e,t){return ok=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},ok(e,t)}function XM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function YM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XM(Object(n),!0).forEach(function(r){ZA(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ZA(e,t,n){return t=Q5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Q5(e){var t=P1e(e,"string");return oc(t)=="symbol"?t:t+""}function P1e(e,t){if(oc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(oc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function E1e(e,t){return M1e(e)||j1e(e,t)||_1e(e,t)||T1e()}function T1e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
353
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _1e(e,t){if(e){if(typeof e=="string")return ZM(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ZM(e,t)}}function ZM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function j1e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function M1e(e){if(Array.isArray(e))return e}function sk(){return sk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sk.apply(this,arguments)}var I1e=function(t,n){var r;return L.isValidElement(t)?r=L.cloneElement(t,n):xe(t)?r=t(n):r=L.createElement("line",sk({},n,{className:"recharts-reference-line-line"})),r},N1e=function(t,n,r,i,o,s,a,l,u){var c=o.x,f=o.y,h=o.width,d=o.height;if(r){var p=u.y,m=t.y.apply(p,{position:s});if(Hi(u,"discard")&&!t.y.isInRange(m))return null;var v=[{x:c+h,y:m},{x:c,y:m}];return l==="left"?v.reverse():v}if(n){var b=u.x,y=t.x.apply(b,{position:s});if(Hi(u,"discard")&&!t.x.isInRange(y))return null;var x=[{x:y,y:f+d},{x:y,y:f}];return a==="top"?x.reverse():x}if(i){var k=u.segment,w=k.map(function(S){return t.apply(S,{position:s})});return Hi(u,"discard")&&Oxe(w,function(S){return!t.isInRange(S)})?null:w}return null};function R1e(e){var t=e.x,n=e.y,r=e.segment,i=e.xAxisId,o=e.yAxisId,s=e.shape,a=e.className,l=e.alwaysShow,u=v1e(),c=H5(i),f=V5(o),h=b1e();if(!u||!h)return null;wo(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var d=YA({x:c.scale,y:f.scale}),p=qt(t),m=qt(n),v=r&&r.length===2,b=N1e(d,p,m,v,h,e.position,c.orientation,f.orientation,e);if(!b)return null;var y=E1e(b,2),x=y[0],k=x.x,w=x.y,S=y[1],O=S.x,A=S.y,P=Hi(e,"hidden")?"url(#".concat(u,")"):void 0,M=YM(YM({clipPath:P},pe(e,!0)),{},{x1:k,y1:w,x2:O,y2:A});return L.createElement($e,{className:Se("recharts-reference-line",a)},I1e(s,M),Yt.renderCallByParent(e,d1e({x1:k,y1:w,x2:O,y2:A})))}var JA=function(e){function t(){return x1e(this,t),k1e(this,t,arguments)}return A1e(t,e),S1e(t,[{key:"render",value:function(){return L.createElement(R1e,this.props)}}])}(L.Component);ZA(JA,"displayName","ReferenceLine");ZA(JA,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function ak(){return ak=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ak.apply(this,arguments)}function sc(e){"@babel/helpers - typeof";return sc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sc(e)}function JM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function eI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JM(Object(n),!0).forEach(function(r){V0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function D1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function L1e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Y5(r.key),r)}}function $1e(e,t,n){return t&&L1e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function B1e(e,t,n){return t=$y(t),F1e(e,X5()?Reflect.construct(t,n||[],$y(e).constructor):t.apply(e,n))}function F1e(e,t){if(t&&(sc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return z1e(e)}function z1e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function X5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(X5=function(){return!!e})()}function $y(e){return $y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},$y(e)}function W1e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lk(e,t)}function lk(e,t){return lk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},lk(e,t)}function V0(e,t,n){return t=Y5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y5(e){var t=U1e(e,"string");return sc(t)=="symbol"?t:t+""}function U1e(e,t){if(sc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(sc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var H1e=function(t){var n=t.x,r=t.y,i=t.xAxis,o=t.yAxis,s=YA({x:i.scale,y:o.scale}),a=s.apply({x:n,y:r},{bandAware:!0});return Hi(t,"discard")&&!s.isInRange(a)?null:a},q0=function(e){function t(){return D1e(this,t),B1e(this,t,arguments)}return W1e(t,e),$1e(t,[{key:"render",value:function(){var r=this.props,i=r.x,o=r.y,s=r.r,a=r.alwaysShow,l=r.clipPathId,u=qt(i),c=qt(o);if(wo(a===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!c)return null;var f=H1e(this.props);if(!f)return null;var h=f.x,d=f.y,p=this.props,m=p.shape,v=p.className,b=Hi(this.props,"hidden")?"url(#".concat(l,")"):void 0,y=eI(eI({clipPath:b},pe(this.props,!0)),{},{cx:h,cy:d});return L.createElement($e,{className:Se("recharts-reference-dot",v)},t.renderDot(m,y),Yt.renderCallByParent(this.props,{x:h-s,y:d-s,width:2*s,height:2*s}))}}])}(L.Component);V0(q0,"displayName","ReferenceDot");V0(q0,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});V0(q0,"renderDot",function(e,t){var n;return L.isValidElement(e)?n=L.cloneElement(e,t):xe(e)?n=e(t):n=L.createElement(L0,ak({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function uk(){return uk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uk.apply(this,arguments)}function ac(e){"@babel/helpers - typeof";return ac=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ac(e)}function tI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function nI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tI(Object(n),!0).forEach(function(r){K0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function V1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function q1e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,J5(r.key),r)}}function K1e(e,t,n){return t&&q1e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function G1e(e,t,n){return t=By(t),Q1e(e,Z5()?Reflect.construct(t,n||[],By(e).constructor):t.apply(e,n))}function Q1e(e,t){if(t&&(ac(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return X1e(e)}function X1e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Z5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Z5=function(){return!!e})()}function By(e){return By=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},By(e)}function Y1e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ck(e,t)}function ck(e,t){return ck=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},ck(e,t)}function K0(e,t,n){return t=J5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function J5(e){var t=Z1e(e,"string");return ac(t)=="symbol"?t:t+""}function Z1e(e,t){if(ac(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ac(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var J1e=function(t,n,r,i,o){var s=o.x1,a=o.x2,l=o.y1,u=o.y2,c=o.xAxis,f=o.yAxis;if(!c||!f)return null;var h=YA({x:c.scale,y:f.scale}),d={x:t?h.x.apply(s,{position:"start"}):h.x.rangeMin,y:r?h.y.apply(l,{position:"start"}):h.y.rangeMin},p={x:n?h.x.apply(a,{position:"end"}):h.x.rangeMax,y:i?h.y.apply(u,{position:"end"}):h.y.rangeMax};return Hi(o,"discard")&&(!h.isInRange(d)||!h.isInRange(p))?null:D5(d,p)},G0=function(e){function t(){return V1e(this,t),G1e(this,t,arguments)}return Y1e(t,e),K1e(t,[{key:"render",value:function(){var r=this.props,i=r.x1,o=r.x2,s=r.y1,a=r.y2,l=r.className,u=r.alwaysShow,c=r.clipPathId;wo(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=qt(i),h=qt(o),d=qt(s),p=qt(a),m=this.props.shape;if(!f&&!h&&!d&&!p&&!m)return null;var v=J1e(f,h,d,p,this.props);if(!v&&!m)return null;var b=Hi(this.props,"hidden")?"url(#".concat(c,")"):void 0;return L.createElement($e,{className:Se("recharts-reference-area",l)},t.renderRect(m,nI(nI({clipPath:b},pe(this.props,!0)),v)),Yt.renderCallByParent(this.props,v))}}])}(L.Component);K0(G0,"displayName","ReferenceArea");K0(G0,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});K0(G0,"renderRect",function(e,t){var n;return L.isValidElement(e)?n=L.cloneElement(e,t):xe(e)?n=e(t):n=L.createElement(XA,uk({},t,{className:"recharts-reference-area-rect"})),n});function ez(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],i=0;i<e.length;i+=t)r.push(e[i]);return r}function ewe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return m1e(r,n)}function twe(e,t,n){var r=n==="width",i=e.x,o=e.y,s=e.width,a=e.height;return t===1?{start:r?i:o,end:r?i+s:o+a}:{start:r?i+s:o+a,end:r?i:o}}function Fy(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var o=n();return e*(t-e*o/2-r)>=0&&e*(t+e*o/2-i)<=0}function nwe(e,t){return ez(e,t+1)}function rwe(e,t,n,r,i){for(var o=(r||[]).slice(),s=t.start,a=t.end,l=0,u=1,c=s,f=function(){var p=r?.[l];if(p===void 0)return{v:ez(r,u)};var m=l,v,b=function(){return v===void 0&&(v=n(p,m)),v},y=p.coordinate,x=l===0||Fy(e,y,b,c,a);x||(l=0,c=s,u+=1),x&&(c=y+e*(b()/2+i),l+=u)},h;u<=o.length;)if(h=f(),h)return h.v;return[]}function xd(e){"@babel/helpers - typeof";return xd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xd(e)}function rI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function mn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rI(Object(n),!0).forEach(function(r){iwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iwe(e,t,n){return t=owe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function owe(e){var t=swe(e,"string");return xd(t)=="symbol"?t:t+""}function swe(e,t){if(xd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function awe(e,t,n,r,i){for(var o=(r||[]).slice(),s=o.length,a=t.start,l=t.end,u=function(h){var d=o[h],p,m=function(){return p===void 0&&(p=n(d,h)),p};if(h===s-1){var v=e*(d.coordinate+e*m()/2-l);o[h]=d=mn(mn({},d),{},{tickCoord:v>0?d.coordinate-v*e:d.coordinate})}else o[h]=d=mn(mn({},d),{},{tickCoord:d.coordinate});var b=Fy(e,d.tickCoord,m,a,l);b&&(l=d.tickCoord-e*(m()/2+i),o[h]=mn(mn({},d),{},{isShow:!0}))},c=s-1;c>=0;c--)u(c);return o}function lwe(e,t,n,r,i,o){var s=(r||[]).slice(),a=s.length,l=t.start,u=t.end;if(o){var c=r[a-1],f=n(c,a-1),h=e*(c.coordinate+e*f/2-u);s[a-1]=c=mn(mn({},c),{},{tickCoord:h>0?c.coordinate-h*e:c.coordinate});var d=Fy(e,c.tickCoord,function(){return f},l,u);d&&(u=c.tickCoord-e*(f/2+i),s[a-1]=mn(mn({},c),{},{isShow:!0}))}for(var p=o?a-1:a,m=function(y){var x=s[y],k,w=function(){return k===void 0&&(k=n(x,y)),k};if(y===0){var S=e*(x.coordinate-e*w()/2-l);s[y]=x=mn(mn({},x),{},{tickCoord:S<0?x.coordinate-S*e:x.coordinate})}else s[y]=x=mn(mn({},x),{},{tickCoord:x.coordinate});var O=Fy(e,x.tickCoord,w,l,u);O&&(l=x.tickCoord+e*(w()/2+i),s[y]=mn(mn({},x),{},{isShow:!0}))},v=0;v<p;v++)m(v);return s}function uwe(e,t,n){var r=e.tick,i=e.ticks,o=e.viewBox,s=e.minTickGap,a=e.orientation,l=e.interval,u=e.tickFormatter,c=e.unit,f=e.angle;if(!i||!i.length||!r)return[];if(ne(l)||dl.isSsr)return nwe(i,typeof l=="number"&&ne(l)?l:0);var h=[],d=a==="top"||a==="bottom"?"width":"height",p=c&&d==="width"?Yf(c,{fontSize:t,letterSpacing:n}):{width:0,height:0},m=function(x,k){var w=xe(u)?u(x.value,k):x.value;return d==="width"?ewe(Yf(w,{fontSize:t,letterSpacing:n}),p,f):Yf(w,{fontSize:t,letterSpacing:n})[d]},v=i.length>=2?Mn(i[1].coordinate-i[0].coordinate):1,b=twe(o,v,d);return l==="equidistantPreserveStart"?rwe(v,b,m,i,s):(l==="preserveStart"||l==="preserveStartEnd"?h=lwe(v,b,m,i,s,l==="preserveStartEnd"):h=awe(v,b,m,i,s),h.filter(function(y){return y.isShow}))}var cwe=["viewBox"],fwe=["viewBox"],hwe=["ticks"];function lc(e){"@babel/helpers - typeof";return lc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lc(e)}function ru(){return ru=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ru.apply(this,arguments)}function iI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $t(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iI(Object(n),!0).forEach(function(r){eP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $x(e,t){if(e==null)return{};var n=dwe(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function dwe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function pwe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,nz(r.key),r)}}function mwe(e,t,n){return t&&oI(e.prototype,t),n&&oI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function gwe(e,t,n){return t=zy(t),ywe(e,tz()?Reflect.construct(t,n||[],zy(e).constructor):t.apply(e,n))}function ywe(e,t){if(t&&(lc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vwe(e)}function vwe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tz=function(){return!!e})()}function zy(e){return zy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},zy(e)}function bwe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fk(e,t)}function fk(e,t){return fk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},fk(e,t)}function eP(e,t,n){return t=nz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nz(e){var t=xwe(e,"string");return lc(t)=="symbol"?t:t+""}function xwe(e,t){if(lc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(lc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Q0=function(e){function t(n){var r;return pwe(this,t),r=gwe(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return bwe(t,e),mwe(t,[{key:"shouldComponentUpdate",value:function(r,i){var o=r.viewBox,s=$x(r,cwe),a=this.props,l=a.viewBox,u=$x(a,fwe);return!bu(o,l)||!bu(s,u)||!bu(i,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var i=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var i=this.props,o=i.x,s=i.y,a=i.width,l=i.height,u=i.orientation,c=i.tickSize,f=i.mirror,h=i.tickMargin,d,p,m,v,b,y,x=f?-1:1,k=r.tickSize||c,w=ne(r.tickCoord)?r.tickCoord:r.coordinate;switch(u){case"top":d=p=r.coordinate,v=s+ +!f*l,m=v-x*k,y=m-x*h,b=w;break;case"left":m=v=r.coordinate,p=o+ +!f*a,d=p-x*k,b=d-x*h,y=w;break;case"right":m=v=r.coordinate,p=o+ +f*a,d=p+x*k,b=d+x*h,y=w;break;default:d=p=r.coordinate,v=s+ +f*l,m=v+x*k,y=m+x*h,b=w;break}return{line:{x1:d,y1:m,x2:p,y2:v},tick:{x:b,y}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,i=r.orientation,o=r.mirror,s;switch(i){case"left":s=o?"start":"end";break;case"right":s=o?"end":"start";break;default:s="middle";break}return s}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,i=r.orientation,o=r.mirror,s="end";switch(i){case"left":case"right":s="middle";break;case"top":s=o?"start":"end";break;default:s=o?"end":"start";break}return s}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.x,o=r.y,s=r.width,a=r.height,l=r.orientation,u=r.mirror,c=r.axisLine,f=$t($t($t({},pe(this.props,!1)),pe(c,!1)),{},{fill:"none"});if(l==="top"||l==="bottom"){var h=+(l==="top"&&!u||l==="bottom"&&u);f=$t($t({},f),{},{x1:i,y1:o+h*a,x2:i+s,y2:o+h*a})}else{var d=+(l==="left"&&!u||l==="right"&&u);f=$t($t({},f),{},{x1:i+d*s,y1:o,x2:i+d*s,y2:o+a})}return L.createElement("line",ru({},f,{className:Se("recharts-cartesian-axis-line",Or(c,"className"))}))}},{key:"renderTicks",value:function(r,i,o){var s=this,a=this.props,l=a.tickLine,u=a.stroke,c=a.tick,f=a.tickFormatter,h=a.unit,d=uwe($t($t({},this.props),{},{ticks:r}),i,o),p=this.getTickTextAnchor(),m=this.getTickVerticalAnchor(),v=pe(this.props,!1),b=pe(c,!1),y=$t($t({},v),{},{fill:"none"},pe(l,!1)),x=d.map(function(k,w){var S=s.getTickLineCoord(k),O=S.line,A=S.tick,P=$t($t($t($t({textAnchor:p,verticalAnchor:m},v),{},{stroke:"none",fill:u},b),A),{},{index:w,payload:k,visibleTicksCount:d.length,tickFormatter:f});return L.createElement($e,ru({className:"recharts-cartesian-axis-tick",key:"tick-".concat(k.value,"-").concat(k.coordinate,"-").concat(k.tickCoord)},Za(s.props,k,w)),l&&L.createElement("line",ru({},y,O,{className:Se("recharts-cartesian-axis-tick-line",Or(l,"className"))})),c&&t.renderTickItem(c,P,"".concat(xe(f)?f(k.value,w):k.value).concat(h||"")))});return L.createElement("g",{className:"recharts-cartesian-axis-ticks"},x)}},{key:"render",value:function(){var r=this,i=this.props,o=i.axisLine,s=i.width,a=i.height,l=i.ticksGenerator,u=i.className,c=i.hide;if(c)return null;var f=this.props,h=f.ticks,d=$x(f,hwe),p=h;return xe(l)&&(p=h&&h.length>0?l(this.props):l(d)),s<=0||a<=0||!p||!p.length?null:L.createElement($e,{className:Se("recharts-cartesian-axis",u),ref:function(v){r.layerReference=v}},o&&this.renderAxisLine(),this.renderTicks(p,this.state.fontSize,this.state.letterSpacing),Yt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,o){var s,a=Se(i.className,"recharts-cartesian-axis-tick-value");return L.isValidElement(r)?s=L.cloneElement(r,$t($t({},i),{},{className:a})):xe(r)?s=r($t($t({},i),{},{className:a})):s=L.createElement(Ja,ru({},i,{className:"recharts-cartesian-axis-tick-value"}),o),s}}])}(C.Component);eP(Q0,"displayName","CartesianAxis");eP(Q0,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var wwe=["type","layout","connectNulls","ref"],Swe=["key"];function uc(e){"@babel/helpers - typeof";return uc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uc(e)}function sI(e,t){if(e==null)return{};var n=kwe(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function kwe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function rh(){return rh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rh.apply(this,arguments)}function aI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aI(Object(n),!0).forEach(function(r){ai(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function El(e){return Pwe(e)||Awe(e)||Cwe(e)||Owe()}function Owe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
354
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cwe(e,t){if(e){if(typeof e=="string")return hk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hk(e,t)}}function Awe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Pwe(e){if(Array.isArray(e))return hk(e)}function hk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ewe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,iz(r.key),r)}}function Twe(e,t,n){return t&&lI(e.prototype,t),n&&lI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _we(e,t,n){return t=Wy(t),jwe(e,rz()?Reflect.construct(t,n||[],Wy(e).constructor):t.apply(e,n))}function jwe(e,t){if(t&&(uc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Mwe(e)}function Mwe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rz=function(){return!!e})()}function Wy(e){return Wy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Wy(e)}function Iwe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dk(e,t)}function dk(e,t){return dk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},dk(e,t)}function ai(e,t,n){return t=iz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iz(e){var t=Nwe(e,"string");return uc(t)=="symbol"?t:t+""}function Nwe(e,t){if(uc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(uc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var sp=function(e){function t(){var n;Ewe(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=_we(this,t,[].concat(i)),ai(n,"state",{isAnimationFinished:!0,totalLength:0}),ai(n,"generateSimpleStrokeDasharray",function(s,a){return"".concat(a,"px ").concat(s-a,"px")}),ai(n,"getStrokeDasharray",function(s,a,l){var u=l.reduce(function(b,y){return b+y});if(!u)return n.generateSimpleStrokeDasharray(a,s);for(var c=Math.floor(s/u),f=s%u,h=a-s,d=[],p=0,m=0;p<l.length;m+=l[p],++p)if(m+l[p]>f){d=[].concat(El(l.slice(0,p)),[f-m]);break}var v=d.length%2===0?[0,h]:[h];return[].concat(El(t.repeat(l,c)),El(d),v).map(function(b){return"".concat(b,"px")}).join(", ")}),ai(n,"id",Rc("recharts-line-")),ai(n,"pathRef",function(s){n.mainCurve=s}),ai(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),ai(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return Iwe(t,e),Twe(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,s=o.points,a=o.xAxis,l=o.yAxis,u=o.layout,c=o.children,f=Cr(c,op);if(!f)return null;var h=function(m,v){return{x:m.x,y:m.y,value:m.value,errorVal:Ut(m.payload,v)}},d={clipPath:r?"url(#clipPath-".concat(i,")"):null};return L.createElement($e,d,f.map(function(p){return L.cloneElement(p,{key:"bar-".concat(p.props.dataKey),data:s,xAxis:a,yAxis:l,layout:u,dataPointFormatter:h})}))}},{key:"renderDots",value:function(r,i,o){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var a=this.props,l=a.dot,u=a.points,c=a.dataKey,f=pe(this.props,!1),h=pe(l,!0),d=u.map(function(m,v){var b=cr(cr(cr({key:"dot-".concat(v),r:3},f),h),{},{index:v,cx:m.x,cy:m.y,value:m.value,dataKey:c,payload:m.payload,points:u});return t.renderDotItem(l,b)}),p={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return L.createElement($e,rh({className:"recharts-line-dots",key:"dots"},p),d)}},{key:"renderCurveStatically",value:function(r,i,o,s){var a=this.props,l=a.type,u=a.layout,c=a.connectNulls;a.ref;var f=sI(a,wwe),h=cr(cr(cr({},pe(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(o,")"):null,points:r},s),{},{type:l,layout:u,connectNulls:c});return L.createElement(wy,rh({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var o=this,s=this.props,a=s.points,l=s.strokeDasharray,u=s.isAnimationActive,c=s.animationBegin,f=s.animationDuration,h=s.animationEasing,d=s.animationId,p=s.animateNewValues,m=s.width,v=s.height,b=this.state,y=b.prevPoints,x=b.totalLength;return L.createElement(Qi,{begin:c,duration:f,isActive:u,easing:h,from:{t:0},to:{t:1},key:"line-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(k){var w=k.t;if(y){var S=y.length/a.length,O=a.map(function(E,D){var R=Math.floor(D*S);if(y[R]){var N=y[R],B=yr(N.x,E.x),F=yr(N.y,E.y);return cr(cr({},E),{},{x:B(w),y:F(w)})}if(p){var $=yr(m*2,E.x),z=yr(v/2,E.y);return cr(cr({},E),{},{x:$(w),y:z(w)})}return cr(cr({},E),{},{x:E.x,y:E.y})});return o.renderCurveStatically(O,r,i)}var A=yr(0,x),P=A(w),M;if(l){var j="".concat(l).split(/[,\s]+/gim).map(function(E){return parseFloat(E)});M=o.getStrokeDasharray(P,x,j)}else M=o.generateSimpleStrokeDasharray(x,P);return o.renderCurveStatically(a,r,i,{strokeDasharray:M})})}},{key:"renderCurve",value:function(r,i){var o=this.props,s=o.points,a=o.isAnimationActive,l=this.state,u=l.prevPoints,c=l.totalLength;return a&&s&&s.length&&(!u&&c>0||!ip(u,s))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(s,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,s=i.dot,a=i.points,l=i.className,u=i.xAxis,c=i.yAxis,f=i.top,h=i.left,d=i.width,p=i.height,m=i.isAnimationActive,v=i.id;if(o||!a||!a.length)return null;var b=this.state.isAnimationFinished,y=a.length===1,x=Se("recharts-line",l),k=u&&u.allowDataOverflow,w=c&&c.allowDataOverflow,S=k||w,O=we(v)?this.id:v,A=(r=pe(s,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},P=A.r,M=P===void 0?3:P,j=A.strokeWidth,E=j===void 0?2:j,D=Eee(s)?s:{},R=D.clipDot,N=R===void 0?!0:R,B=M*2+E;return L.createElement($e,{className:x},k||w?L.createElement("defs",null,L.createElement("clipPath",{id:"clipPath-".concat(O)},L.createElement("rect",{x:k?h:h-d/2,y:w?f:f-p/2,width:k?d:d*2,height:w?p:p*2})),!N&&L.createElement("clipPath",{id:"clipPath-dots-".concat(O)},L.createElement("rect",{x:h-B/2,y:f-B/2,width:d+B,height:p+B}))):null,!y&&this.renderCurve(S,O),this.renderErrorBar(S,O),(y||s)&&this.renderDots(S,N,O),(!m||b)&&ko.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,i){for(var o=r.length%2!==0?[].concat(El(r),[0]):r,s=[],a=0;a<i;++a)s=[].concat(El(s),El(o));return s}},{key:"renderDotItem",value:function(r,i){var o;if(L.isValidElement(r))o=L.cloneElement(r,i);else if(xe(r))o=r(i);else{var s=i.key,a=sI(i,Swe),l=Se("recharts-line-dot",typeof r!="boolean"?r.className:"");o=L.createElement(L0,rh({key:s},a,{className:l}))}return o}}])}(C.PureComponent);ai(sp,"displayName","Line");ai(sp,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!dl.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});ai(sp,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,i=e.xAxisTicks,o=e.yAxisTicks,s=e.dataKey,a=e.bandSize,l=e.displayedData,u=e.offset,c=t.layout,f=l.map(function(h,d){var p=Ut(h,s);return c==="horizontal"?{x:Lj({axis:n,ticks:i,bandSize:a,entry:h,index:d}),y:we(p)?null:r.scale(p),value:p,payload:h}:{x:we(p)?null:n.scale(p),y:Lj({axis:r,ticks:o,bandSize:a,entry:h,index:d}),value:p,payload:h}});return cr({points:f,layout:c},u)});function cc(e){"@babel/helpers - typeof";return cc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cc(e)}function Rwe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dwe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,az(r.key),r)}}function Lwe(e,t,n){return t&&Dwe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $we(e,t,n){return t=Uy(t),Bwe(e,oz()?Reflect.construct(t,n||[],Uy(e).constructor):t.apply(e,n))}function Bwe(e,t){if(t&&(cc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Fwe(e)}function Fwe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(oz=function(){return!!e})()}function Uy(e){return Uy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Uy(e)}function zwe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pk(e,t)}function pk(e,t){return pk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},pk(e,t)}function sz(e,t,n){return t=az(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function az(e){var t=Wwe(e,"string");return cc(t)=="symbol"?t:t+""}function Wwe(e,t){if(cc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(cc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function mk(){return mk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mk.apply(this,arguments)}function Uwe(e){var t=e.xAxisId,n=q5(),r=K5(),i=H5(t);return i==null?null:C.createElement(Q0,mk({},i,{className:Se("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(s){return Ca(s,!0)}}))}var Wc=function(e){function t(){return Rwe(this,t),$we(this,t,arguments)}return zwe(t,e),Lwe(t,[{key:"render",value:function(){return C.createElement(Uwe,this.props)}}])}(C.Component);sz(Wc,"displayName","XAxis");sz(Wc,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function fc(e){"@babel/helpers - typeof";return fc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fc(e)}function Hwe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vwe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,cz(r.key),r)}}function qwe(e,t,n){return t&&Vwe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Kwe(e,t,n){return t=Hy(t),Gwe(e,lz()?Reflect.construct(t,n||[],Hy(e).constructor):t.apply(e,n))}function Gwe(e,t){if(t&&(fc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qwe(e)}function Qwe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(lz=function(){return!!e})()}function Hy(e){return Hy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Hy(e)}function Xwe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gk(e,t)}function gk(e,t){return gk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},gk(e,t)}function uz(e,t,n){return t=cz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cz(e){var t=Ywe(e,"string");return fc(t)=="symbol"?t:t+""}function Ywe(e,t){if(fc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(fc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function yk(){return yk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yk.apply(this,arguments)}var Zwe=function(t){var n=t.yAxisId,r=q5(),i=K5(),o=V5(n);return o==null?null:C.createElement(Q0,yk({},o,{className:Se("recharts-".concat(o.axisType," ").concat(o.axisType),o.className),viewBox:{x:0,y:0,width:r,height:i},ticksGenerator:function(a){return Ca(a,!0)}}))},Uc=function(e){function t(){return Hwe(this,t),Kwe(this,t,arguments)}return Xwe(t,e),qwe(t,[{key:"render",value:function(){return C.createElement(Zwe,this.props)}}])}(C.Component);uz(Uc,"displayName","YAxis");uz(Uc,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function uI(e){return nSe(e)||tSe(e)||eSe(e)||Jwe()}function Jwe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
355
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eSe(e,t){if(e){if(typeof e=="string")return vk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vk(e,t)}}function tSe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function nSe(e){if(Array.isArray(e))return vk(e)}function vk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var bk=function(t,n,r,i,o){var s=Cr(t,JA),a=Cr(t,q0),l=[].concat(uI(s),uI(a)),u=Cr(t,G0),c="".concat(i,"Id"),f=i[0],h=n;if(l.length&&(h=l.reduce(function(m,v){if(v.props[c]===r&&Hi(v.props,"extendDomain")&&ne(v.props[f])){var b=v.props[f];return[Math.min(m[0],b),Math.max(m[1],b)]}return m},h)),u.length){var d="".concat(f,"1"),p="".concat(f,"2");h=u.reduce(function(m,v){if(v.props[c]===r&&Hi(v.props,"extendDomain")&&ne(v.props[d])&&ne(v.props[p])){var b=v.props[d],y=v.props[p];return[Math.min(m[0],b,y),Math.max(m[1],b,y)]}return m},h)}return o&&o.length&&(h=o.reduce(function(m,v){return ne(v)?[Math.min(m[0],v),Math.max(m[1],v)]:m},h)),h},fz={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(l,u,c){this.fn=l,this.context=u,this.once=c||!1}function o(l,u,c,f,h){if(typeof c!="function")throw new TypeError("The listener must be a function");var d=new i(c,f||l,h),p=n?n+u:u;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],d]:l._events[p].push(d):(l._events[p]=d,l._eventsCount++),l}function s(l,u){--l._eventsCount===0?l._events=new r:delete l._events[u]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var u=[],c,f;if(this._eventsCount===0)return u;for(f in c=this._events)t.call(c,f)&&u.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(c)):u},a.prototype.listeners=function(u){var c=n?n+u:u,f=this._events[c];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,d=f.length,p=new Array(d);h<d;h++)p[h]=f[h].fn;return p},a.prototype.listenerCount=function(u){var c=n?n+u:u,f=this._events[c];return f?f.fn?1:f.length:0},a.prototype.emit=function(u,c,f,h,d,p){var m=n?n+u:u;if(!this._events[m])return!1;var v=this._events[m],b=arguments.length,y,x;if(v.fn){switch(v.once&&this.removeListener(u,v.fn,void 0,!0),b){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,c),!0;case 3:return v.fn.call(v.context,c,f),!0;case 4:return v.fn.call(v.context,c,f,h),!0;case 5:return v.fn.call(v.context,c,f,h,d),!0;case 6:return v.fn.call(v.context,c,f,h,d,p),!0}for(x=1,y=new Array(b-1);x<b;x++)y[x-1]=arguments[x];v.fn.apply(v.context,y)}else{var k=v.length,w;for(x=0;x<k;x++)switch(v[x].once&&this.removeListener(u,v[x].fn,void 0,!0),b){case 1:v[x].fn.call(v[x].context);break;case 2:v[x].fn.call(v[x].context,c);break;case 3:v[x].fn.call(v[x].context,c,f);break;case 4:v[x].fn.call(v[x].context,c,f,h);break;default:if(!y)for(w=1,y=new Array(b-1);w<b;w++)y[w-1]=arguments[w];v[x].fn.apply(v[x].context,y)}}return!0},a.prototype.on=function(u,c,f){return o(this,u,c,f,!1)},a.prototype.once=function(u,c,f){return o(this,u,c,f,!0)},a.prototype.removeListener=function(u,c,f,h){var d=n?n+u:u;if(!this._events[d])return this;if(!c)return s(this,d),this;var p=this._events[d];if(p.fn)p.fn===c&&(!h||p.once)&&(!f||p.context===f)&&s(this,d);else{for(var m=0,v=[],b=p.length;m<b;m++)(p[m].fn!==c||h&&!p[m].once||f&&p[m].context!==f)&&v.push(p[m]);v.length?this._events[d]=v.length===1?v[0]:v:s(this,d)}return this},a.prototype.removeAllListeners=function(u){var c;return u?(c=n?n+u:u,this._events[c]&&s(this,c)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a})(fz);var rSe=fz.exports;const iSe=ze(rSe);var Bx=new iSe,Fx="recharts.syncMouseEvents";function wd(e){"@babel/helpers - typeof";return wd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wd(e)}function oSe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sSe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,hz(r.key),r)}}function aSe(e,t,n){return t&&sSe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function zx(e,t,n){return t=hz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hz(e){var t=lSe(e,"string");return wd(t)=="symbol"?t:t+""}function lSe(e,t){if(wd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(wd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var uSe=function(){function e(){oSe(this,e),zx(this,"activeIndex",0),zx(this,"coordinateList",[]),zx(this,"layout","horizontal")}return aSe(e,[{key:"setDetails",value:function(n){var r,i=n.coordinateList,o=i===void 0?null:i,s=n.container,a=s===void 0?null:s,l=n.layout,u=l===void 0?null:l,c=n.offset,f=c===void 0?null:c,h=n.mouseHandlerCallback,d=h===void 0?null:h;this.coordinateList=(r=o??this.coordinateList)!==null&&r!==void 0?r:[],this.container=a??this.container,this.layout=u??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=d??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),o=i.x,s=i.y,a=i.height,l=this.coordinateList[this.activeIndex].coordinate,u=((n=window)===null||n===void 0?void 0:n.scrollX)||0,c=((r=window)===null||r===void 0?void 0:r.scrollY)||0,f=o+l+u,h=s+this.offset.top+a/2+c;this.mouseHandlerCallback({pageX:f,pageY:h})}}}])}();function cSe(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e?.[0],i=e?.[1];if(r&&i&&ne(r)&&ne(i))return!0}return!1}function fSe(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function dz(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,o=e.endAngle,s=st(t,n,r,i),a=st(t,n,r,o);return{points:[s,a],cx:t,cy:n,radius:r,startAngle:i,endAngle:o}}function hSe(e,t,n){var r,i,o,s;if(e==="horizontal")r=t.x,o=r,i=n.top,s=n.top+n.height;else if(e==="vertical")i=t.y,s=i,r=n.left,o=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var a=t.cx,l=t.cy,u=t.innerRadius,c=t.outerRadius,f=t.angle,h=st(a,l,u,f),d=st(a,l,c,f);r=h.x,i=h.y,o=d.x,s=d.y}else return dz(t);return[{x:r,y:i},{x:o,y:s}]}function Sd(e){"@babel/helpers - typeof";return Sd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sd(e)}function cI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function tm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cI(Object(n),!0).forEach(function(r){dSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dSe(e,t,n){return t=pSe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pSe(e){var t=mSe(e,"string");return Sd(t)=="symbol"?t:t+""}function mSe(e,t){if(Sd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Sd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gSe(e){var t,n,r=e.element,i=e.tooltipEventType,o=e.isActive,s=e.activeCoordinate,a=e.activePayload,l=e.offset,u=e.activeTooltipIndex,c=e.tooltipAxisBandSize,f=e.layout,h=e.chartName,d=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!d||!o||!s||h!=="ScatterChart"&&i!=="axis")return null;var p,m=wy;if(h==="ScatterChart")p=s,m=f0e;else if(h==="BarChart")p=fSe(f,s,l,c),m=XA;else if(f==="radial"){var v=dz(s),b=v.cx,y=v.cy,x=v.radius,k=v.startAngle,w=v.endAngle;p={cx:b,cy:y,startAngle:k,endAngle:w,innerRadius:x,outerRadius:x},m=u5}else p={points:hSe(f,s,l)},m=wy;var S=tm(tm(tm(tm({stroke:"#ccc",pointerEvents:"none"},l),p),pe(d,!1)),{},{payload:a,payloadIndex:u,className:Se("recharts-tooltip-cursor",d.className)});return C.isValidElement(d)?C.cloneElement(d,S):C.createElement(m,S)}var ySe=["item"],vSe=["children","className","width","height","style","compact","title","desc"];function hc(e){"@babel/helpers - typeof";return hc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hc(e)}function iu(){return iu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},iu.apply(this,arguments)}function fI(e,t){return wSe(e)||xSe(e,t)||mz(e,t)||bSe()}function bSe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
356
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xSe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function wSe(e){if(Array.isArray(e))return e}function hI(e,t){if(e==null)return{};var n=SSe(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function SSe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function kSe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OSe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,gz(r.key),r)}}function CSe(e,t,n){return t&&OSe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ASe(e,t,n){return t=Vy(t),PSe(e,pz()?Reflect.construct(t,n||[],Vy(e).constructor):t.apply(e,n))}function PSe(e,t){if(t&&(hc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ESe(e)}function ESe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(pz=function(){return!!e})()}function Vy(e){return Vy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Vy(e)}function TSe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xk(e,t)}function xk(e,t){return xk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},xk(e,t)}function dc(e){return MSe(e)||jSe(e)||mz(e)||_Se()}function _Se(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
357
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mz(e,t){if(e){if(typeof e=="string")return wk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wk(e,t)}}function jSe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function MSe(e){if(Array.isArray(e))return wk(e)}function wk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function dI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dI(Object(n),!0).forEach(function(r){me(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function me(e,t,n){return t=gz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gz(e){var t=ISe(e,"string");return hc(t)=="symbol"?t:t+""}function ISe(e,t){if(hc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(hc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var NSe={xAxis:["bottom","top"],yAxis:["left","right"]},RSe={width:"100%",height:"100%"},yz={x:0,y:0};function nm(e){return e}var DSe=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},LSe=function(t,n,r,i){var o=n.find(function(c){return c&&c.index===r});if(o){if(t==="horizontal")return{x:o.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:o.coordinate};if(t==="centric"){var s=o.coordinate,a=i.radius;return H(H(H({},i),st(i.cx,i.cy,a,s)),{},{angle:s,radius:a})}var l=o.coordinate,u=i.angle;return H(H(H({},i),st(i.cx,i.cy,l,u)),{},{angle:u,radius:l})}return yz},X0=function(t,n){var r=n.graphicalItems,i=n.dataStartIndex,o=n.dataEndIndex,s=(r??[]).reduce(function(a,l){var u=l.props.data;return u&&u.length?[].concat(dc(a),dc(u)):a},[]);return s.length>0?s:t&&t.length&&ne(i)&&ne(o)?t.slice(i,o+1):[]};function vz(e){return e==="number"?[0,"auto"]:void 0}var Sk=function(t,n,r,i){var o=t.graphicalItems,s=t.tooltipAxis,a=X0(n,t);return r<0||!o||!o.length||r>=a.length?null:o.reduce(function(l,u){var c,f=(c=u.props.data)!==null&&c!==void 0?c:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(s.dataKey&&!s.allowDuplicatedCategory){var d=f===void 0?a:f;h=Ug(d,s.dataKey,i)}else h=f&&f[r]||a[r];return h?[].concat(dc(l),[r5(u,h)]):l},[])},pI=function(t,n,r,i){var o=i||{x:t.chartX,y:t.chartY},s=DSe(o,r),a=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,c=_me(s,a,u,l);if(c>=0&&u){var f=u[c]&&u[c].value,h=Sk(t,n,c,f),d=LSe(r,a,c,o);return{activeTooltipIndex:c,activeLabel:f,activePayload:h,activeCoordinate:d}}return null},$Se=function(t,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,s=n.axisIdKey,a=n.stackGroups,l=n.dataStartIndex,u=n.dataEndIndex,c=t.layout,f=t.children,h=t.stackOffset,d=Z4(c,o);return r.reduce(function(p,m){var v,b=m.type.defaultProps!==void 0?H(H({},m.type.defaultProps),m.props):m.props,y=b.type,x=b.dataKey,k=b.allowDataOverflow,w=b.allowDuplicatedCategory,S=b.scale,O=b.ticks,A=b.includeHidden,P=b[s];if(p[P])return p;var M=X0(t.data,{graphicalItems:i.filter(function(I){var _,K=s in I.props?I.props[s]:(_=I.type.defaultProps)===null||_===void 0?void 0:_[s];return K===P}),dataStartIndex:l,dataEndIndex:u}),j=M.length,E,D,R;cSe(b.domain,k,y)&&(E=RS(b.domain,null,k),d&&(y==="number"||S!=="auto")&&(R=Jf(M,x,"category")));var N=vz(y);if(!E||E.length===0){var B,F=(B=b.domain)!==null&&B!==void 0?B:N;if(x){if(E=Jf(M,x,y),y==="category"&&d){var $=vee(E);w&&$?(D=E,E=My(0,j)):w||(E=zj(F,E,m).reduce(function(I,_){return I.indexOf(_)>=0?I:[].concat(dc(I),[_])},[]))}else if(y==="category")w?E=E.filter(function(I){return I!==""&&!we(I)}):E=zj(F,E,m).reduce(function(I,_){return I.indexOf(_)>=0||_===""||we(_)?I:[].concat(dc(I),[_])},[]);else if(y==="number"){var z=Rme(M,i.filter(function(I){var _,K,Q=s in I.props?I.props[s]:(_=I.type.defaultProps)===null||_===void 0?void 0:_[s],te="hide"in I.props?I.props.hide:(K=I.type.defaultProps)===null||K===void 0?void 0:K.hide;return Q===P&&(A||!te)}),x,o,c);z&&(E=z)}d&&(y==="number"||S!=="auto")&&(R=Jf(M,x,"category"))}else d?E=My(0,j):a&&a[P]&&a[P].hasStack&&y==="number"?E=h==="expand"?[0,1]:n5(a[P].stackGroups,l,u):E=Y4(M,i.filter(function(I){var _=s in I.props?I.props[s]:I.type.defaultProps[s],K="hide"in I.props?I.props.hide:I.type.defaultProps.hide;return _===P&&(A||!K)}),y,c,!0);if(y==="number")E=bk(f,E,P,o,O),F&&(E=RS(F,E,k));else if(y==="category"&&F){var T=F,q=E.every(function(I){return T.indexOf(I)>=0});q&&(E=T)}}return H(H({},p),{},me({},P,H(H({},b),{},{axisType:o,domain:E,categoricalDomain:R,duplicateDomain:D,originalDomain:(v=b.domain)!==null&&v!==void 0?v:N,isCategorical:d,layout:c})))},{})},BSe=function(t,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,s=n.axisIdKey,a=n.stackGroups,l=n.dataStartIndex,u=n.dataEndIndex,c=t.layout,f=t.children,h=X0(t.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:u}),d=h.length,p=Z4(c,o),m=-1;return r.reduce(function(v,b){var y=b.type.defaultProps!==void 0?H(H({},b.type.defaultProps),b.props):b.props,x=y[s],k=vz("number");if(!v[x]){m++;var w;return p?w=My(0,d):a&&a[x]&&a[x].hasStack?(w=n5(a[x].stackGroups,l,u),w=bk(f,w,x,o)):(w=RS(k,Y4(h,r.filter(function(S){var O,A,P=s in S.props?S.props[s]:(O=S.type.defaultProps)===null||O===void 0?void 0:O[s],M="hide"in S.props?S.props.hide:(A=S.type.defaultProps)===null||A===void 0?void 0:A.hide;return P===x&&!M}),"number",c),i.defaultProps.allowDataOverflow),w=bk(f,w,x,o)),H(H({},v),{},me({},x,H(H({axisType:o},i.defaultProps),{},{hide:!0,orientation:Or(NSe,"".concat(o,".").concat(m%2),null),domain:w,originalDomain:k,isCategorical:p,layout:c})))}return v},{})},FSe=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,s=n.graphicalItems,a=n.stackGroups,l=n.dataStartIndex,u=n.dataEndIndex,c=t.children,f="".concat(i,"Id"),h=Cr(c,o),d={};return h&&h.length?d=$Se(t,{axes:h,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:a,dataStartIndex:l,dataEndIndex:u}):s&&s.length&&(d=BSe(t,{Axis:o,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:a,dataStartIndex:l,dataEndIndex:u})),d},zSe=function(t){var n=Dl(t),r=Ca(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:kA(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:vy(n,r)}},mI=function(t){var n=t.children,r=t.defaultShowTooltip,i=pr(n,rc),o=0,s=0;return t.data&&t.data.length!==0&&(s=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(s=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!r}},WSe=function(t){return!t||!t.length?!1:t.some(function(n){var r=xo(n&&n.type);return r&&r.indexOf("Bar")>=0})},gI=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},USe=function(t,n){var r=t.props,i=t.graphicalItems,o=t.xAxisMap,s=o===void 0?{}:o,a=t.yAxisMap,l=a===void 0?{}:a,u=r.width,c=r.height,f=r.children,h=r.margin||{},d=pr(f,rc),p=pr(f,xu),m=Object.keys(l).reduce(function(w,S){var O=l[S],A=O.orientation;return!O.mirror&&!O.hide?H(H({},w),{},me({},A,w[A]+O.width)):w},{left:h.left||0,right:h.right||0}),v=Object.keys(s).reduce(function(w,S){var O=s[S],A=O.orientation;return!O.mirror&&!O.hide?H(H({},w),{},me({},A,Or(w,"".concat(A))+O.height)):w},{top:h.top||0,bottom:h.bottom||0}),b=H(H({},v),m),y=b.bottom;d&&(b.bottom+=d.props.height||rc.defaultProps.height),p&&n&&(b=Ime(b,i,r,n));var x=u-b.left-b.right,k=c-b.top-b.bottom;return H(H({brushBottom:y},b),{},{width:Math.max(x,0),height:Math.max(k,0)})},HSe=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},tP=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,o=i===void 0?"axis":i,s=t.validateTooltipEventTypes,a=s===void 0?["axis"]:s,l=t.axisComponents,u=t.legendContent,c=t.formatAxisMap,f=t.defaultProps,h=function(b,y){var x=y.graphicalItems,k=y.stackGroups,w=y.offset,S=y.updateId,O=y.dataStartIndex,A=y.dataEndIndex,P=b.barSize,M=b.layout,j=b.barGap,E=b.barCategoryGap,D=b.maxBarSize,R=gI(M),N=R.numericAxisName,B=R.cateAxisName,F=WSe(x),$=[];return x.forEach(function(z,T){var q=X0(b.data,{graphicalItems:[z],dataStartIndex:O,dataEndIndex:A}),I=z.type.defaultProps!==void 0?H(H({},z.type.defaultProps),z.props):z.props,_=I.dataKey,K=I.maxBarSize,Q=I["".concat(N,"Id")],te=I["".concat(B,"Id")],he={},ve=l.reduce(function(Jr,jr){var Ys=y["".concat(jr.axisType,"Map")],Zs=I["".concat(jr.axisType,"Id")];Ys&&Ys[Zs]||jr.axisType==="zAxis"||tl();var Ue=Ys[Zs];return H(H({},Jr),{},me(me({},jr.axisType,Ue),"".concat(jr.axisType,"Ticks"),Ca(Ue)))},he),X=ve[B],ue=ve["".concat(B,"Ticks")],ge=k&&k[Q]&&k[Q].hasStack&&Hme(z,k[Q].stackGroups),Y=xo(z.type).indexOf("Bar")>=0,Qe=vy(X,ue),Pe=[],dt=F&&jme({barSize:P,stackGroups:k,totalSize:HSe(ve,B)});if(Y){var at,Mt,nn=we(K)?D:K,or=(at=(Mt=vy(X,ue,!0))!==null&&Mt!==void 0?Mt:nn)!==null&&at!==void 0?at:0;Pe=Mme({barGap:j,barCategoryGap:E,bandSize:or!==Qe?or:Qe,sizeList:dt[te],maxBarSize:nn}),or!==Qe&&(Pe=Pe.map(function(Jr){return H(H({},Jr),{},{position:H(H({},Jr.position),{},{offset:Jr.position.offset-or/2})})}))}var Cn=z&&z.type&&z.type.getComposedData;Cn&&$.push({props:H(H({},Cn(H(H({},ve),{},{displayedData:q,props:b,dataKey:_,item:z,bandSize:Qe,barPosition:Pe,offset:w,stackedData:ge,layout:M,dataStartIndex:O,dataEndIndex:A}))),{},me(me(me({key:z.key||"item-".concat(T)},N,ve[N]),B,ve[B]),"animationId",S)),childIndex:jee(z,b.children),item:z})}),$},d=function(b,y){var x=b.props,k=b.dataStartIndex,w=b.dataEndIndex,S=b.updateId;if(!N2({props:x}))return null;var O=x.children,A=x.layout,P=x.stackOffset,M=x.data,j=x.reverseStackOrder,E=gI(A),D=E.numericAxisName,R=E.cateAxisName,N=Cr(O,r),B=Wme(M,N,"".concat(D,"Id"),"".concat(R,"Id"),P,j),F=l.reduce(function(I,_){var K="".concat(_.axisType,"Map");return H(H({},I),{},me({},K,FSe(x,H(H({},_),{},{graphicalItems:N,stackGroups:_.axisType===D&&B,dataStartIndex:k,dataEndIndex:w}))))},{}),$=USe(H(H({},F),{},{props:x,graphicalItems:N}),y?.legendBBox);Object.keys(F).forEach(function(I){F[I]=c(x,F[I],$,I.replace("Map",""),n)});var z=F["".concat(R,"Map")],T=zSe(z),q=h(x,H(H({},F),{},{dataStartIndex:k,dataEndIndex:w,updateId:S,graphicalItems:N,stackGroups:B,offset:$}));return H(H({formattedGraphicalItems:q,graphicalItems:N,offset:$,stackGroups:B},T),F)},p=function(v){function b(y){var x,k,w;return kSe(this,b),w=ASe(this,b,[y]),me(w,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),me(w,"accessibilityManager",new uSe),me(w,"handleLegendBBoxUpdate",function(S){if(S){var O=w.state,A=O.dataStartIndex,P=O.dataEndIndex,M=O.updateId;w.setState(H({legendBBox:S},d({props:w.props,dataStartIndex:A,dataEndIndex:P,updateId:M},H(H({},w.state),{},{legendBBox:S}))))}}),me(w,"handleReceiveSyncEvent",function(S,O,A){if(w.props.syncId===S){if(A===w.eventEmitterSymbol&&typeof w.props.syncMethod!="function")return;w.applySyncEvent(O)}}),me(w,"handleBrushChange",function(S){var O=S.startIndex,A=S.endIndex;if(O!==w.state.dataStartIndex||A!==w.state.dataEndIndex){var P=w.state.updateId;w.setState(function(){return H({dataStartIndex:O,dataEndIndex:A},d({props:w.props,dataStartIndex:O,dataEndIndex:A,updateId:P},w.state))}),w.triggerSyncEvent({dataStartIndex:O,dataEndIndex:A})}}),me(w,"handleMouseEnter",function(S){var O=w.getMouseInfo(S);if(O){var A=H(H({},O),{},{isTooltipActive:!0});w.setState(A),w.triggerSyncEvent(A);var P=w.props.onMouseEnter;xe(P)&&P(A,S)}}),me(w,"triggeredAfterMouseMove",function(S){var O=w.getMouseInfo(S),A=O?H(H({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};w.setState(A),w.triggerSyncEvent(A);var P=w.props.onMouseMove;xe(P)&&P(A,S)}),me(w,"handleItemMouseEnter",function(S){w.setState(function(){return{isTooltipActive:!0,activeItem:S,activePayload:S.tooltipPayload,activeCoordinate:S.tooltipPosition||{x:S.cx,y:S.cy}}})}),me(w,"handleItemMouseLeave",function(){w.setState(function(){return{isTooltipActive:!1}})}),me(w,"handleMouseMove",function(S){S.persist(),w.throttleTriggeredAfterMouseMove(S)}),me(w,"handleMouseLeave",function(S){w.throttleTriggeredAfterMouseMove.cancel();var O={isTooltipActive:!1};w.setState(O),w.triggerSyncEvent(O);var A=w.props.onMouseLeave;xe(A)&&A(O,S)}),me(w,"handleOuterEvent",function(S){var O=_ee(S),A=Or(w.props,"".concat(O));if(O&&xe(A)){var P,M;/.*touch.*/i.test(O)?M=w.getMouseInfo(S.changedTouches[0]):M=w.getMouseInfo(S),A((P=M)!==null&&P!==void 0?P:{},S)}}),me(w,"handleClick",function(S){var O=w.getMouseInfo(S);if(O){var A=H(H({},O),{},{isTooltipActive:!0});w.setState(A),w.triggerSyncEvent(A);var P=w.props.onClick;xe(P)&&P(A,S)}}),me(w,"handleMouseDown",function(S){var O=w.props.onMouseDown;if(xe(O)){var A=w.getMouseInfo(S);O(A,S)}}),me(w,"handleMouseUp",function(S){var O=w.props.onMouseUp;if(xe(O)){var A=w.getMouseInfo(S);O(A,S)}}),me(w,"handleTouchMove",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&w.throttleTriggeredAfterMouseMove(S.changedTouches[0])}),me(w,"handleTouchStart",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&w.handleMouseDown(S.changedTouches[0])}),me(w,"handleTouchEnd",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&w.handleMouseUp(S.changedTouches[0])}),me(w,"handleDoubleClick",function(S){var O=w.props.onDoubleClick;if(xe(O)){var A=w.getMouseInfo(S);O(A,S)}}),me(w,"handleContextMenu",function(S){var O=w.props.onContextMenu;if(xe(O)){var A=w.getMouseInfo(S);O(A,S)}}),me(w,"triggerSyncEvent",function(S){w.props.syncId!==void 0&&Bx.emit(Fx,w.props.syncId,S,w.eventEmitterSymbol)}),me(w,"applySyncEvent",function(S){var O=w.props,A=O.layout,P=O.syncMethod,M=w.state.updateId,j=S.dataStartIndex,E=S.dataEndIndex;if(S.dataStartIndex!==void 0||S.dataEndIndex!==void 0)w.setState(H({dataStartIndex:j,dataEndIndex:E},d({props:w.props,dataStartIndex:j,dataEndIndex:E,updateId:M},w.state)));else if(S.activeTooltipIndex!==void 0){var D=S.chartX,R=S.chartY,N=S.activeTooltipIndex,B=w.state,F=B.offset,$=B.tooltipTicks;if(!F)return;if(typeof P=="function")N=P($,S);else if(P==="value"){N=-1;for(var z=0;z<$.length;z++)if($[z].value===S.activeLabel){N=z;break}}var T=H(H({},F),{},{x:F.left,y:F.top}),q=Math.min(D,T.x+T.width),I=Math.min(R,T.y+T.height),_=$[N]&&$[N].value,K=Sk(w.state,w.props.data,N),Q=$[N]?{x:A==="horizontal"?$[N].coordinate:q,y:A==="horizontal"?I:$[N].coordinate}:yz;w.setState(H(H({},S),{},{activeLabel:_,activeCoordinate:Q,activePayload:K,activeTooltipIndex:N}))}else w.setState(S)}),me(w,"renderCursor",function(S){var O,A=w.state,P=A.isTooltipActive,M=A.activeCoordinate,j=A.activePayload,E=A.offset,D=A.activeTooltipIndex,R=A.tooltipAxisBandSize,N=w.getTooltipEventType(),B=(O=S.props.active)!==null&&O!==void 0?O:P,F=w.props.layout,$=S.key||"_recharts-cursor";return L.createElement(gSe,{key:$,activeCoordinate:M,activePayload:j,activeTooltipIndex:D,chartName:n,element:S,isActive:B,layout:F,offset:E,tooltipAxisBandSize:R,tooltipEventType:N})}),me(w,"renderPolarAxis",function(S,O,A){var P=Or(S,"type.axisType"),M=Or(w.state,"".concat(P,"Map")),j=S.type.defaultProps,E=j!==void 0?H(H({},j),S.props):S.props,D=M&&M[E["".concat(P,"Id")]];return C.cloneElement(S,H(H({},D),{},{className:Se(P,D.className),key:S.key||"".concat(O,"-").concat(A),ticks:Ca(D,!0)}))}),me(w,"renderPolarGrid",function(S){var O=S.props,A=O.radialLines,P=O.polarAngles,M=O.polarRadius,j=w.state,E=j.radiusAxisMap,D=j.angleAxisMap,R=Dl(E),N=Dl(D),B=N.cx,F=N.cy,$=N.innerRadius,z=N.outerRadius;return C.cloneElement(S,{polarAngles:Array.isArray(P)?P:Ca(N,!0).map(function(T){return T.coordinate}),polarRadius:Array.isArray(M)?M:Ca(R,!0).map(function(T){return T.coordinate}),cx:B,cy:F,innerRadius:$,outerRadius:z,key:S.key||"polar-grid",radialLines:A})}),me(w,"renderLegend",function(){var S=w.state.formattedGraphicalItems,O=w.props,A=O.children,P=O.width,M=O.height,j=w.props.margin||{},E=P-(j.left||0)-(j.right||0),D=Q4({children:A,formattedGraphicalItems:S,legendWidth:E,legendContent:u});if(!D)return null;var R=D.item,N=hI(D,ySe);return C.cloneElement(R,H(H({},N),{},{chartWidth:P,chartHeight:M,margin:j,onBBoxUpdate:w.handleLegendBBoxUpdate}))}),me(w,"renderTooltip",function(){var S,O=w.props,A=O.children,P=O.accessibilityLayer,M=pr(A,oi);if(!M)return null;var j=w.state,E=j.isTooltipActive,D=j.activeCoordinate,R=j.activePayload,N=j.activeLabel,B=j.offset,F=(S=M.props.active)!==null&&S!==void 0?S:E;return C.cloneElement(M,{viewBox:H(H({},B),{},{x:B.left,y:B.top}),active:F,label:N,payload:F?R:[],coordinate:D,accessibilityLayer:P})}),me(w,"renderBrush",function(S){var O=w.props,A=O.margin,P=O.data,M=w.state,j=M.offset,E=M.dataStartIndex,D=M.dataEndIndex,R=M.updateId;return C.cloneElement(S,{key:S.key||"_recharts-brush",onChange:Yp(w.handleBrushChange,S.props.onChange),data:P,x:ne(S.props.x)?S.props.x:j.left,y:ne(S.props.y)?S.props.y:j.top+j.height+j.brushBottom-(A.bottom||0),width:ne(S.props.width)?S.props.width:j.width,startIndex:E,endIndex:D,updateId:"brush-".concat(R)})}),me(w,"renderReferenceElement",function(S,O,A){if(!S)return null;var P=w,M=P.clipPathId,j=w.state,E=j.xAxisMap,D=j.yAxisMap,R=j.offset,N=S.type.defaultProps||{},B=S.props,F=B.xAxisId,$=F===void 0?N.xAxisId:F,z=B.yAxisId,T=z===void 0?N.yAxisId:z;return C.cloneElement(S,{key:S.key||"".concat(O,"-").concat(A),xAxis:E[$],yAxis:D[T],viewBox:{x:R.left,y:R.top,width:R.width,height:R.height},clipPathId:M})}),me(w,"renderActivePoints",function(S){var O=S.item,A=S.activePoint,P=S.basePoint,M=S.childIndex,j=S.isRange,E=[],D=O.props.key,R=O.item.type.defaultProps!==void 0?H(H({},O.item.type.defaultProps),O.item.props):O.item.props,N=R.activeDot,B=R.dataKey,F=H(H({index:M,dataKey:B,cx:A.x,cy:A.y,r:4,fill:QA(O.item),strokeWidth:2,stroke:"#fff",payload:A.payload,value:A.value},pe(N,!1)),Hg(N));return E.push(b.renderActiveDot(N,F,"".concat(D,"-activePoint-").concat(M))),P?E.push(b.renderActiveDot(N,H(H({},F),{},{cx:P.x,cy:P.y}),"".concat(D,"-basePoint-").concat(M))):j&&E.push(null),E}),me(w,"renderGraphicChild",function(S,O,A){var P=w.filterFormatItem(S,O,A);if(!P)return null;var M=w.getTooltipEventType(),j=w.state,E=j.isTooltipActive,D=j.tooltipAxis,R=j.activeTooltipIndex,N=j.activeLabel,B=w.props.children,F=pr(B,oi),$=P.props,z=$.points,T=$.isRange,q=$.baseLine,I=P.item.type.defaultProps!==void 0?H(H({},P.item.type.defaultProps),P.item.props):P.item.props,_=I.activeDot,K=I.hide,Q=I.activeBar,te=I.activeShape,he=!!(!K&&E&&F&&(_||Q||te)),ve={};M!=="axis"&&F&&F.props.trigger==="click"?ve={onClick:Yp(w.handleItemMouseEnter,S.props.onClick)}:M!=="axis"&&(ve={onMouseLeave:Yp(w.handleItemMouseLeave,S.props.onMouseLeave),onMouseEnter:Yp(w.handleItemMouseEnter,S.props.onMouseEnter)});var X=C.cloneElement(S,H(H({},P.props),ve));function ue(jr){return typeof D.dataKey=="function"?D.dataKey(jr.payload):null}if(he)if(R>=0){var ge,Y;if(D.dataKey&&!D.allowDuplicatedCategory){var Qe=typeof D.dataKey=="function"?ue:"payload.".concat(D.dataKey.toString());ge=Ug(z,Qe,N),Y=T&&q&&Ug(q,Qe,N)}else ge=z?.[R],Y=T&&q&&q[R];if(te||Q){var Pe=S.props.activeIndex!==void 0?S.props.activeIndex:R;return[C.cloneElement(S,H(H(H({},P.props),ve),{},{activeIndex:Pe})),null,null]}if(!we(ge))return[X].concat(dc(w.renderActivePoints({item:P,activePoint:ge,basePoint:Y,childIndex:R,isRange:T})))}else{var dt,at=(dt=w.getItemByXY(w.state.activeCoordinate))!==null&&dt!==void 0?dt:{graphicalItem:X},Mt=at.graphicalItem,nn=Mt.item,or=nn===void 0?S:nn,Cn=Mt.childIndex,Jr=H(H(H({},P.props),ve),{},{activeIndex:Cn});return[C.cloneElement(or,Jr),null,null]}return T?[X,null,null]:[X,null]}),me(w,"renderCustomized",function(S,O,A){return C.cloneElement(S,H(H({key:"recharts-customized-".concat(A)},w.props),w.state))}),me(w,"renderMap",{CartesianGrid:{handler:nm,once:!0},ReferenceArea:{handler:w.renderReferenceElement},ReferenceLine:{handler:nm},ReferenceDot:{handler:w.renderReferenceElement},XAxis:{handler:nm},YAxis:{handler:nm},Brush:{handler:w.renderBrush,once:!0},Bar:{handler:w.renderGraphicChild},Line:{handler:w.renderGraphicChild},Area:{handler:w.renderGraphicChild},Radar:{handler:w.renderGraphicChild},RadialBar:{handler:w.renderGraphicChild},Scatter:{handler:w.renderGraphicChild},Pie:{handler:w.renderGraphicChild},Funnel:{handler:w.renderGraphicChild},Tooltip:{handler:w.renderCursor,once:!0},PolarGrid:{handler:w.renderPolarGrid,once:!0},PolarAngleAxis:{handler:w.renderPolarAxis},PolarRadiusAxis:{handler:w.renderPolarAxis},Customized:{handler:w.renderCustomized}}),w.clipPathId="".concat((x=y.id)!==null&&x!==void 0?x:Rc("recharts"),"-clip"),w.throttleTriggeredAfterMouseMove=G3(w.triggeredAfterMouseMove,(k=y.throttleDelay)!==null&&k!==void 0?k:1e3/60),w.state={},w}return TSe(b,v),CSe(b,[{key:"componentDidMount",value:function(){var x,k;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(k=this.props.margin.top)!==null&&k!==void 0?k:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,k=x.children,w=x.data,S=x.height,O=x.layout,A=pr(k,oi);if(A){var P=A.props.defaultIndex;if(!(typeof P!="number"||P<0||P>this.state.tooltipTicks.length-1)){var M=this.state.tooltipTicks[P]&&this.state.tooltipTicks[P].value,j=Sk(this.state,w,P,M),E=this.state.tooltipTicks[P].coordinate,D=(this.state.offset.top+S)/2,R=O==="horizontal",N=R?{x:E,y:D}:{y:E,x:D},B=this.state.formattedGraphicalItems.find(function($){var z=$.item;return z.type.name==="Scatter"});B&&(N=H(H({},N),B.props.points[P].tooltipPosition),j=B.props.points[P].tooltipPayload);var F={activeTooltipIndex:P,isTooltipActive:!0,activeLabel:M,activePayload:j,activeCoordinate:N};this.setState(F),this.renderCursor(A),this.accessibilityManager.setIndex(P)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,k){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==k.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==x.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==x.margin){var w,S;this.accessibilityManager.setDetails({offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0}})}return null}},{key:"componentDidUpdate",value:function(x){Xw([pr(x.children,oi)],[pr(this.props.children,oi)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=pr(this.props.children,oi);if(x&&typeof x.props.shared=="boolean"){var k=x.props.shared?"axis":"item";return a.indexOf(k)>=0?k:o}return o}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var k=this.container,w=k.getBoundingClientRect(),S=ife(w),O={chartX:Math.round(x.pageX-S.left),chartY:Math.round(x.pageY-S.top)},A=w.width/k.offsetWidth||1,P=this.inRange(O.chartX,O.chartY,A);if(!P)return null;var M=this.state,j=M.xAxisMap,E=M.yAxisMap,D=this.getTooltipEventType(),R=pI(this.state,this.props.data,this.props.layout,P);if(D!=="axis"&&j&&E){var N=Dl(j).scale,B=Dl(E).scale,F=N&&N.invert?N.invert(O.chartX):null,$=B&&B.invert?B.invert(O.chartY):null;return H(H({},O),{},{xValue:F,yValue:$},R)}return R?H(H({},O),R):null}},{key:"inRange",value:function(x,k){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,S=this.props.layout,O=x/w,A=k/w;if(S==="horizontal"||S==="vertical"){var P=this.state.offset,M=O>=P.left&&O<=P.left+P.width&&A>=P.top&&A<=P.top+P.height;return M?{x:O,y:A}:null}var j=this.state,E=j.angleAxisMap,D=j.radiusAxisMap;if(E&&D){var R=Dl(E);return Hj({x:O,y:A},R)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,k=this.getTooltipEventType(),w=pr(x,oi),S={};w&&k==="axis"&&(w.props.trigger==="click"?S={onClick:this.handleClick}:S={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var O=Hg(this.props,this.handleOuterEvent);return H(H({},O),S)}},{key:"addListener",value:function(){Bx.on(Fx,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Bx.removeListener(Fx,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,k,w){for(var S=this.state.formattedGraphicalItems,O=0,A=S.length;O<A;O++){var P=S[O];if(P.item===x||P.props.key===x.key||k===xo(P.item.type)&&w===P.childIndex)return P}return null}},{key:"renderClipPath",value:function(){var x=this.clipPathId,k=this.state.offset,w=k.left,S=k.top,O=k.height,A=k.width;return L.createElement("defs",null,L.createElement("clipPath",{id:x},L.createElement("rect",{x:w,y:S,height:O,width:A})))}},{key:"getXScales",value:function(){var x=this.state.xAxisMap;return x?Object.entries(x).reduce(function(k,w){var S=fI(w,2),O=S[0],A=S[1];return H(H({},k),{},me({},O,A.scale))},{}):null}},{key:"getYScales",value:function(){var x=this.state.yAxisMap;return x?Object.entries(x).reduce(function(k,w){var S=fI(w,2),O=S[0],A=S[1];return H(H({},k),{},me({},O,A.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(x){var k;return(k=this.state.xAxisMap)===null||k===void 0||(k=k[x])===null||k===void 0?void 0:k.scale}},{key:"getYScaleByAxisId",value:function(x){var k;return(k=this.state.yAxisMap)===null||k===void 0||(k=k[x])===null||k===void 0?void 0:k.scale}},{key:"getItemByXY",value:function(x){var k=this.state,w=k.formattedGraphicalItems,S=k.activeItem;if(w&&w.length)for(var O=0,A=w.length;O<A;O++){var P=w[O],M=P.props,j=P.item,E=j.type.defaultProps!==void 0?H(H({},j.type.defaultProps),j.props):j.props,D=xo(j.type);if(D==="Bar"){var R=(M.data||[]).find(function($){return Vve(x,$)});if(R)return{graphicalItem:P,payload:R}}else if(D==="RadialBar"){var N=(M.data||[]).find(function($){return Hj(x,$)});if(N)return{graphicalItem:P,payload:N}}else if(W0(P,S)||U0(P,S)||gd(P,S)){var B=Ibe({graphicalItem:P,activeTooltipItem:S,itemData:E.data}),F=E.activeIndex===void 0?B:E.activeIndex;return{graphicalItem:H(H({},P),{},{childIndex:F}),payload:gd(P,S)?E.data[B]:P.props.data[B]}}}return null}},{key:"render",value:function(){var x=this;if(!N2(this))return null;var k=this.props,w=k.children,S=k.className,O=k.width,A=k.height,P=k.style,M=k.compact,j=k.title,E=k.desc,D=hI(k,vSe),R=pe(D,!1);if(M)return L.createElement(QM,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},L.createElement(Zw,iu({},R,{width:O,height:A,title:j,desc:E}),this.renderClipPath(),D2(w,this.renderMap)));if(this.props.accessibilityLayer){var N,B;R.tabIndex=(N=this.props.tabIndex)!==null&&N!==void 0?N:0,R.role=(B=this.props.role)!==null&&B!==void 0?B:"application",R.onKeyDown=function($){x.accessibilityManager.keyboardEvent($)},R.onFocus=function(){x.accessibilityManager.focus()}}var F=this.parseEventsOfWrapper();return L.createElement(QM,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},L.createElement("div",iu({className:Se("recharts-wrapper",S),style:H({position:"relative",cursor:"default",width:O,height:A},P)},F,{ref:function(z){x.container=z}}),L.createElement(Zw,iu({},R,{width:O,height:A,title:j,desc:E,style:RSe}),this.renderClipPath(),D2(w,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(C.Component);me(p,"displayName",n),me(p,"defaultProps",H({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),me(p,"getDerivedStateFromProps",function(v,b){var y=v.dataKey,x=v.data,k=v.children,w=v.width,S=v.height,O=v.layout,A=v.stackOffset,P=v.margin,M=b.dataStartIndex,j=b.dataEndIndex;if(b.updateId===void 0){var E=mI(v);return H(H(H({},E),{},{updateId:0},d(H(H({props:v},E),{},{updateId:0}),b)),{},{prevDataKey:y,prevData:x,prevWidth:w,prevHeight:S,prevLayout:O,prevStackOffset:A,prevMargin:P,prevChildren:k})}if(y!==b.prevDataKey||x!==b.prevData||w!==b.prevWidth||S!==b.prevHeight||O!==b.prevLayout||A!==b.prevStackOffset||!bu(P,b.prevMargin)){var D=mI(v),R={chartX:b.chartX,chartY:b.chartY,isTooltipActive:b.isTooltipActive},N=H(H({},pI(b,x,O)),{},{updateId:b.updateId+1}),B=H(H(H({},D),R),N);return H(H(H({},B),d(H({props:v},B),b)),{},{prevDataKey:y,prevData:x,prevWidth:w,prevHeight:S,prevLayout:O,prevStackOffset:A,prevMargin:P,prevChildren:k})}if(!Xw(k,b.prevChildren)){var F,$,z,T,q=pr(k,rc),I=q&&(F=($=q.props)===null||$===void 0?void 0:$.startIndex)!==null&&F!==void 0?F:M,_=q&&(z=(T=q.props)===null||T===void 0?void 0:T.endIndex)!==null&&z!==void 0?z:j,K=I!==M||_!==j,Q=!we(x),te=Q&&!K?b.updateId:b.updateId+1;return H(H({updateId:te},d(H(H({props:v},b),{},{updateId:te,dataStartIndex:I,dataEndIndex:_}),b)),{},{prevChildren:k,dataStartIndex:I,dataEndIndex:_})}return null}),me(p,"renderActiveDot",function(v,b,y){var x;return C.isValidElement(v)?x=C.cloneElement(v,b):xe(v)?x=v(b):x=L.createElement(L0,b),L.createElement($e,{className:"recharts-active-dot",key:y},x)});var m=C.forwardRef(function(b,y){return L.createElement(p,iu({},b,{ref:y}))});return m.displayName=p.displayName,m},VSe=tP({chartName:"LineChart",GraphicalChild:sp,axisComponents:[{axisType:"xAxis",AxisComp:Wc},{axisType:"yAxis",AxisComp:Uc}],formatAxisMap:R5}),qSe=tP({chartName:"BarChart",GraphicalChild:yl,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Wc},{axisType:"yAxis",AxisComp:Uc}],formatAxisMap:R5}),KSe=tP({chartName:"PieChart",GraphicalChild:Wo,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:z0},{axisType:"radiusAxis",AxisComp:B0}],formatAxisMap:ege,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});function nP({ratio:e}){const t=Math.round(e*100),n=[{name:"hit",value:t},{name:"miss",value:100-t}];return g.jsxs("div",{className:"relative",style:{width:140,height:140},children:[g.jsx(KSe,{width:140,height:140,children:g.jsxs(Wo,{data:n,dataKey:"value",cx:"50%",cy:"50%",innerRadius:48,outerRadius:62,startAngle:90,endAngle:-270,stroke:"none",children:[g.jsx(Ku,{fill:"var(--color-ok)"}),g.jsx(Ku,{fill:"var(--gray-5)"})]})}),g.jsxs("div",{className:"pointer-events-none absolute inset-0 flex flex-col items-center justify-center",children:[g.jsxs("span",{className:"text-[20px] font-semibold tabular text-[var(--color-text)]",children:[t,"%"]}),g.jsx("span",{className:"text-[11px] text-[var(--color-text-muted)]",children:"cache hit"})]})]})}function bz({runs:e}){const n=e.slice(0,20).reverse().map((r,i)=>({n:i+1,sec:Math.round(r.durationMs/1e3*10)/10}));return n.length===0?null:g.jsx("div",{className:"h-[140px] w-full min-w-0",children:g.jsx(Q3,{width:"100%",height:"100%",children:g.jsxs(qSe,{data:n,margin:{top:8,right:8,left:0,bottom:0},children:[g.jsx(Wc,{dataKey:"n",hide:!0,stroke:"var(--gray-5)"}),g.jsx(Uc,{hide:!0,domain:[0,"auto"],stroke:"var(--gray-5)"}),g.jsx(oi,{contentStyle:{background:"var(--color-surface)",border:"1px solid var(--color-border-strong)",borderRadius:"8px"},labelFormatter:r=>`Run ${r}`,formatter:r=>[`${r}s`,"Duration"]}),g.jsx(yl,{dataKey:"sec",radius:[4,4,0,0],maxBarSize:28,children:n.map((r,i)=>g.jsx(Ku,{fill:i===n.length-1?"var(--color-ok)":"var(--color-text-muted)"},`cell-${i}`))})]})})})}function xz({runs:e}){const n=e.slice(0,20).reverse().map((r,i)=>({n:i+1,tokens:r.inputTokens+r.outputTokens}));return n.length===0?null:g.jsx("div",{className:"h-[140px] w-full min-w-0",children:g.jsx(Q3,{width:"100%",height:"100%",children:g.jsxs(VSe,{data:n,margin:{top:8,right:8,left:0,bottom:0},children:[g.jsx(Wc,{dataKey:"n",hide:!0,stroke:"var(--gray-5)"}),g.jsx(Uc,{hide:!0,domain:["auto","auto"],stroke:"var(--gray-5)"}),g.jsx(oi,{contentStyle:{background:"var(--color-surface)",border:"1px solid var(--color-border-strong)",borderRadius:"8px"},labelFormatter:r=>`Run ${r}`,formatter:r=>[`${r.toLocaleString()} tokens`,"Total"]}),g.jsx(sp,{type:"monotone",dataKey:"tokens",stroke:"var(--color-text)",strokeWidth:2,dot:!1,activeDot:{r:4,fill:"var(--color-text)"}})]})})})}function GSe(e){const t=new Map;for(const n of e){const r=t.get(n.feature)??[];r.push(n),t.set(n.feature,r)}for(const n of t.values())n.sort((r,i)=>r.id.localeCompare(i.id));return t}function QSe(){const e=yi();C.useEffect(()=>{Me("/api/projects/touch",{method:"POST"}).then(()=>e.invalidateQueries({queryKey:["recent-projects"]}))},[e]);const t=wt({queryKey:["dashboard"],queryFn:()=>Me("/api/dashboard")}),n=t.error,r=n instanceof kr;if(r)return g.jsx(Ce,{title:"Dashboard",description:"Overview of this workspace and recent planner telemetry.",children:g.jsxs(Ae,{tone:"warning",title:n instanceof kr?n.message:new kr().message,children:["Reopen ",g.jsx(Wi,{children:"squad console"})," from your project and use the new URL."]})});const i=!r&&n?String(n):null,o=t.data,s=o?.lastRun??null,a=s?.stats.cacheHitRatio??0,l=s!=null?`${Math.round(a*100)}%`:"—",u=o?.runs??[],c=o?.stories?GSe(o.stories):null;return g.jsxs(Ce,{title:"Dashboard",description:"Overview of this workspace and recent planner telemetry.",children:[i?g.jsx(Ae,{tone:"danger",children:i}):null,g.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[g.jsxs(He,{variant:"default",children:[g.jsx("div",{className:"text-xs font-medium uppercase tracking-wide text-[var(--color-text-dim)]",children:"Project"}),t.isPending?g.jsx(Tn,{className:"mt-2 h-8 w-3/4"}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"mt-2 text-lg font-semibold text-[var(--color-text)]",children:o?.project.name??"—"}),o?.project.primaryLanguage?g.jsx("div",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:o.project.primaryLanguage}):null,o?.root?g.jsx("div",{className:"mt-3 truncate font-mono text-[11px] text-[var(--color-text-dim)]",children:o.root}):null]})]}),g.jsxs(He,{variant:"default",children:[g.jsx("div",{className:"text-xs font-medium uppercase tracking-wide text-[var(--color-text-dim)]",children:"Planner"}),t.isPending?g.jsx(Tn,{className:"mt-2 h-8 w-2/3"}):o?.planner?g.jsxs("div",{className:"mt-2 flex items-center gap-2 text-lg font-semibold",children:[o.planner.enabled?g.jsx("span",{className:"h-2 w-2 rounded-full bg-[var(--color-accent)] shadow-[0_0_10px_var(--color-accent)]"}):null,g.jsx("span",{children:o.planner.provider})]}):g.jsx("div",{className:"mt-2 text-lg font-semibold text-[var(--color-text-muted)]",children:"not configured"})]}),g.jsxs(He,{variant:"default",children:[g.jsx("div",{className:"text-xs font-medium uppercase tracking-wide text-[var(--color-text-dim)]",children:"Last cache hit"}),t.isPending?g.jsx(Tn,{className:"mt-2 h-8 w-20"}):g.jsx("div",{className:"mt-2 text-2xl font-semibold tabular-nums text-[var(--color-text)]",children:l})]})]}),g.jsx("div",{className:"grid gap-4 lg:grid-cols-3",children:u.length===0?g.jsxs(He,{variant:"default",className:"lg:col-span-3",children:[g.jsx("h2",{className:"mb-2 text-lg font-semibold text-[var(--color-text)]",children:"Run history"}),g.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:["No runs yet — kick one off in"," ",g.jsx(vt,{to:"/generate",className:"text-[var(--color-accent)] hover:underline",children:"Generate"}),"."]})]}):g.jsxs(g.Fragment,{children:[g.jsxs(He,{variant:"default",children:[g.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--color-text)]",children:"Cache hit ratio"}),g.jsx("div",{className:"flex justify-center",children:g.jsx(nP,{ratio:a})})]}),g.jsxs(He,{variant:"default",children:[g.jsxs("h2",{className:"mb-4 text-sm font-semibold text-[var(--color-text)]",children:["Token spend (last ",Math.min(20,u.length)," runs)"]}),g.jsx(xz,{runs:u})]}),g.jsxs(He,{variant:"default",children:[g.jsxs("h2",{className:"mb-4 text-sm font-semibold text-[var(--color-text)]",children:["Run duration (last ",Math.min(20,u.length)," runs)"]}),g.jsx(bz,{runs:u})]})]})}),g.jsxs(He,{variant:"default",children:[g.jsx("div",{className:"mb-4",children:g.jsx("h2",{className:"text-lg font-semibold text-[var(--color-text)]",children:"Stories"})}),t.isPending?g.jsxs("div",{className:"space-y-3",children:[g.jsx(Tn,{className:"h-10 w-full"}),g.jsx(Tn,{className:"h-10 w-full"})]}):c&&c.size>0?g.jsx("div",{className:"space-y-6",children:[...c.entries()].sort((f,h)=>f[0].localeCompare(h[0])).map(([f,h])=>g.jsxs("div",{children:[g.jsx("div",{className:"mb-2 px-3 text-[11px] font-semibold uppercase tracking-wider text-[var(--color-text-dim)]",children:f}),g.jsx("ul",{className:"overflow-hidden rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)]",children:h.map((d,p)=>g.jsx("li",{children:g.jsxs(vt,{to:"/stories/$feature/$id",params:{feature:d.feature,id:d.id},className:"flex items-center gap-3 px-3 py-[var(--space-row-y)] text-[13px] hover:bg-[var(--gray-4)] transition-colors "+(p>0?"border-t border-[var(--color-border)]":""),children:[g.jsx("span",{className:"w-20 shrink-0 font-mono text-[12px] text-[var(--color-text-muted)]",children:d.id}),g.jsx("span",{className:"min-w-0 flex-1 truncate",children:d.titleHint||g.jsx("span",{className:"text-[var(--color-text-dim)]",children:"no title"})}),d.planFile?g.jsx(Ee,{tone:"success",dot:!0,children:"planned"}):g.jsx(Ee,{tone:"default",children:"unplanned"})]})},`${d.feature}/${d.id}`))})]},f))}):g.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"No stories yet."})]})]})}const ct=C.forwardRef(function({leftSlot:t,rightSlot:n,invalid:r,className:i="",...o},s){return g.jsxs("div",{"data-invalid":r||void 0,className:`flex w-full items-center gap-2 rounded-[var(--radius-md)] border bg-[var(--gray-2)] px-3 py-2 text-sm border-[var(--color-border)] focus-within:border-[var(--color-border-strong)] data-[invalid]:border-[var(--color-fail)] transition-colors ${i}`,children:[t?g.jsx("span",{className:"text-[var(--color-text-dim)]",children:t}):null,g.jsx("input",{ref:s,className:"flex-1 bg-transparent text-[var(--color-text)] placeholder:text-[var(--color-text-dim)] outline-none",...o}),n?g.jsx("span",{className:"text-[var(--color-text-dim)]",children:n}):null]})}),La=C.forwardRef(function({className:t="",children:n,...r},i){return g.jsxs("div",{className:`relative w-full ${t}`,children:[g.jsx("select",{ref:i,className:`
|
|
358
|
-
w-full appearance-none rounded-[var(--radius-md)] border border-[var(--color-border)]
|
|
359
|
-
bg-[var(--gray-2)] px-3 py-2 pr-9 text-sm text-[var(--color-text)]
|
|
360
|
-
outline-none focus:border-[var(--color-border-strong)]
|
|
361
|
-
transition-colors
|
|
362
|
-
`,...r,children:n}),g.jsx(bF,{size:14,className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-[var(--color-text-dim)]","aria-hidden":!0})]})});function yI(e){return e.toLowerCase().trim().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"").slice(0,80)}const wf="__new__";function XSe(e){switch(e){case"jira":return"Jira issue id";case"azure":return"Azure work item id";case"github":return"GitHub issue id";default:return"Work item id"}}function YSe({open:e,onOpenChange:t}){const n=_r(),r=yi(),i=wt({queryKey:["meta"],queryFn:()=>Me("/api/meta")}),o=wt({queryKey:["stories"],queryFn:()=>Me("/api/stories")}),[s,a]=C.useState(wf),[l,u]=C.useState(""),[c,f]=C.useState(""),[h,d]=C.useState(""),p=C.useMemo(()=>{const y=new Set;for(const x of o.data??[])y.add(x.feature);return[...y].sort()},[o.data]),m=Ps({mutationFn:()=>{const x={feature:s===wf?yI(l.trim())||"feature":s,title:c.trim()||void 0};return h.trim()&&(x.trackerId=h.trim()),Me("/api/stories",{method:"POST",body:JSON.stringify(x)})},onSuccess:y=>{r.invalidateQueries({queryKey:["stories"]}),t(!1),f(""),d(""),u(""),a(wf),n({to:"/stories/$feature/$id",params:{feature:y.feature,id:y.id}})}}),v=i.data?.tracker.type??"none",b=v!=="none";return g.jsx(Tc,{open:e,onClose:()=>t(!1),title:"New story",footer:g.jsxs("div",{className:"flex w-full justify-end gap-2",children:[g.jsx("button",{type:"button",className:"btn-secondary",onClick:()=>t(!1),children:"Cancel"}),g.jsx(fe,{type:"button",disabled:m.isPending,onClick:()=>{m.mutate()},children:"Create"})]}),children:g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{children:[g.jsx("div",{className:"mb-1 text-xs text-[var(--color-text-dim)]",children:"Feature"}),g.jsxs(La,{value:s,onChange:y=>a(y.target.value),disabled:!o.data&&o.isLoading,children:[p.map(y=>g.jsx("option",{value:y,children:y},y)),g.jsx("option",{value:wf,children:"New feature…"})]}),s===wf&&g.jsx("div",{className:"mt-2",children:g.jsx(ct,{placeholder:"kebab-case feature slug",value:l,onChange:y=>u(y.target.value),onBlur:()=>u(y=>yI(y))})})]}),g.jsxs("div",{children:[g.jsx("div",{className:"mb-1 text-xs text-[var(--color-text-dim)]",children:"Title (optional if tracker id set)"}),g.jsx(ct,{value:c,onChange:y=>f(y.target.value),placeholder:"Short title"})]}),b&&g.jsxs("div",{children:[g.jsxs("div",{className:"mb-1 text-xs text-[var(--color-text-dim)]",children:[XSe(v)," (optional)"]}),g.jsx(ct,{value:h,onChange:y=>d(y.target.value),placeholder:"Leave empty to create without a tracker link"})]}),m.isError&&g.jsx("p",{className:"text-sm text-[var(--color-fail)]",children:m.error.message})]})})}function wz(e){const t=new Map;for(const n of e){const r=t.get(n.feature)??[];r.push(n),t.set(n.feature,r)}return[...t.entries()].sort(([n],[r])=>n.localeCompare(r)).map(([n,r])=>({feature:n,stories:r.sort((i,o)=>i.id.localeCompare(o.id))}))}function ZSe(){const e=wt({queryKey:["stories"],queryFn:()=>Me("/api/stories")}),[t,n]=C.useState(!1),r=_r();if(C.useEffect(()=>{const o=()=>n(!0);return window.addEventListener("squad:dialog:new-story",o),()=>window.removeEventListener("squad:dialog:new-story",o)},[]),e.isLoading)return g.jsx(Ce,{title:"Stories",description:"Intake files grouped by feature. Open a story to edit or run the planner.",children:g.jsx("div",{className:"space-y-2",children:Array.from({length:8}).map((o,s)=>g.jsx(Tn,{className:"h-9"},s))})});if(e.isError)return g.jsx(Ce,{title:"Stories",description:"Intake files grouped by feature. Open a story to edit or run the planner.",children:g.jsx(Ae,{tone:"danger",children:e.error.message})});const i=wz(e.data??[]);return g.jsxs(Ce,{title:"Stories",description:"Intake files grouped by feature. Open a story to edit or run the planner.",actions:g.jsx(fe,{type:"button",leftIcon:g.jsx(ZC,{size:14}),onClick:()=>n(!0),children:"New story"}),children:[i.length===0?g.jsxs(Ae,{tone:"info",children:["No stories yet."," ",g.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>n(!0),children:"Create one"})," ","to get started."]}):g.jsx("div",{className:"space-y-8",children:i.map(({feature:o,stories:s})=>g.jsxs("div",{children:[g.jsx("div",{className:"mb-2 px-3 text-[11px] font-semibold uppercase tracking-wider text-[var(--color-text-dim)]",children:o}),g.jsx("ul",{className:"overflow-hidden rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)]",children:s.map((a,l)=>g.jsxs("li",{className:"flex items-center gap-3 border-[var(--color-border)] px-3 py-[var(--space-row-y)] text-[13px] "+(l>0?"border-t":""),children:[g.jsx("span",{className:"w-20 shrink-0 font-mono text-[12px] text-[var(--color-text-muted)]",children:a.id}),g.jsx("span",{className:"min-w-0 flex-1 truncate",children:a.titleHint||g.jsx("span",{className:"text-[var(--color-text-dim)]",children:"no title"})}),a.planFile?g.jsx(Ee,{tone:"success",dot:!0,children:"planned"}):g.jsx(Ee,{tone:"default",children:"unplanned"}),g.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[g.jsx(fe,{type:"button",variant:"ghost",size:"sm",onClick:()=>void r({to:"/generate",search:{feature:a.feature,storyId:a.id}}),children:"Generate"}),g.jsx(fe,{type:"button",variant:"secondary",size:"sm",onClick:()=>void r({to:"/stories/$feature/$id",params:{feature:a.feature,id:a.id}}),children:"Open"})]})]},a.id))})]},o))}),g.jsx(YSe,{open:t,onOpenChange:n})]})}function JSe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const eke=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,tke=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nke={};function vI(e,t){return(nke.jsx?tke:eke).test(e)}const rke=/[ \t\n\f\r]/g;function ike(e){return typeof e=="object"?e.type==="text"?bI(e.value):!1:bI(e)}function bI(e){return e.replace(rke,"")===""}let ap=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};ap.prototype.normal={};ap.prototype.property={};ap.prototype.space=void 0;function Sz(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new ap(n,r,t)}function kk(e){return e.toLowerCase()}class ir{constructor(t,n){this.attribute=n,this.property=t}}ir.prototype.attribute="";ir.prototype.booleanish=!1;ir.prototype.boolean=!1;ir.prototype.commaOrSpaceSeparated=!1;ir.prototype.commaSeparated=!1;ir.prototype.defined=!1;ir.prototype.mustUseProperty=!1;ir.prototype.number=!1;ir.prototype.overloadedBoolean=!1;ir.prototype.property="";ir.prototype.spaceSeparated=!1;ir.prototype.space=void 0;let oke=0;const Oe=vl(),Nt=vl(),Ok=vl(),J=vl(),et=vl(),ku=vl(),fr=vl();function vl(){return 2**++oke}const Ck=Object.freeze(Object.defineProperty({__proto__:null,boolean:Oe,booleanish:Nt,commaOrSpaceSeparated:fr,commaSeparated:ku,number:J,overloadedBoolean:Ok,spaceSeparated:et},Symbol.toStringTag,{value:"Module"})),Wx=Object.keys(Ck);class rP extends ir{constructor(t,n,r,i){let o=-1;if(super(t,n),xI(this,"space",i),typeof r=="number")for(;++o<Wx.length;){const s=Wx[o];xI(this,Wx[o],(r&Ck[s])===Ck[s])}}}rP.prototype.defined=!0;function xI(e,t,n){n&&(e[t]=n)}function Hc(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new rP(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[kk(r)]=r,n[kk(o.attribute)]=r}return new ap(t,n,e.space)}const kz=Hc({properties:{ariaActiveDescendant:null,ariaAtomic:Nt,ariaAutoComplete:null,ariaBusy:Nt,ariaChecked:Nt,ariaColCount:J,ariaColIndex:J,ariaColSpan:J,ariaControls:et,ariaCurrent:null,ariaDescribedBy:et,ariaDetails:null,ariaDisabled:Nt,ariaDropEffect:et,ariaErrorMessage:null,ariaExpanded:Nt,ariaFlowTo:et,ariaGrabbed:Nt,ariaHasPopup:null,ariaHidden:Nt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:et,ariaLevel:J,ariaLive:null,ariaModal:Nt,ariaMultiLine:Nt,ariaMultiSelectable:Nt,ariaOrientation:null,ariaOwns:et,ariaPlaceholder:null,ariaPosInSet:J,ariaPressed:Nt,ariaReadOnly:Nt,ariaRelevant:null,ariaRequired:Nt,ariaRoleDescription:et,ariaRowCount:J,ariaRowIndex:J,ariaRowSpan:J,ariaSelected:Nt,ariaSetSize:J,ariaSort:null,ariaValueMax:J,ariaValueMin:J,ariaValueNow:J,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Oz(e,t){return t in e?e[t]:t}function Cz(e,t){return Oz(e,t.toLowerCase())}const ske=Hc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ku,acceptCharset:et,accessKey:et,action:null,allow:null,allowFullScreen:Oe,allowPaymentRequest:Oe,allowUserMedia:Oe,alt:null,as:null,async:Oe,autoCapitalize:null,autoComplete:et,autoFocus:Oe,autoPlay:Oe,blocking:et,capture:null,charSet:null,checked:Oe,cite:null,className:et,cols:J,colSpan:null,content:null,contentEditable:Nt,controls:Oe,controlsList:et,coords:J|ku,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Oe,defer:Oe,dir:null,dirName:null,disabled:Oe,download:Ok,draggable:Nt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Oe,formTarget:null,headers:et,height:J,hidden:Ok,high:J,href:null,hrefLang:null,htmlFor:et,httpEquiv:et,id:null,imageSizes:null,imageSrcSet:null,inert:Oe,inputMode:null,integrity:null,is:null,isMap:Oe,itemId:null,itemProp:et,itemRef:et,itemScope:Oe,itemType:et,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Oe,low:J,manifest:null,max:null,maxLength:J,media:null,method:null,min:null,minLength:J,multiple:Oe,muted:Oe,name:null,nonce:null,noModule:Oe,noValidate:Oe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Oe,optimum:J,pattern:null,ping:et,placeholder:null,playsInline:Oe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Oe,referrerPolicy:null,rel:et,required:Oe,reversed:Oe,rows:J,rowSpan:J,sandbox:et,scope:null,scoped:Oe,seamless:Oe,selected:Oe,shadowRootClonable:Oe,shadowRootDelegatesFocus:Oe,shadowRootMode:null,shape:null,size:J,sizes:null,slot:null,span:J,spellCheck:Nt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:J,step:null,style:null,tabIndex:J,target:null,title:null,translate:null,type:null,typeMustMatch:Oe,useMap:null,value:Nt,width:J,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:et,axis:null,background:null,bgColor:null,border:J,borderColor:null,bottomMargin:J,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Oe,declare:Oe,event:null,face:null,frame:null,frameBorder:null,hSpace:J,leftMargin:J,link:null,longDesc:null,lowSrc:null,marginHeight:J,marginWidth:J,noResize:Oe,noHref:Oe,noShade:Oe,noWrap:Oe,object:null,profile:null,prompt:null,rev:null,rightMargin:J,rules:null,scheme:null,scrolling:Nt,standby:null,summary:null,text:null,topMargin:J,valueType:null,version:null,vAlign:null,vLink:null,vSpace:J,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Oe,disableRemotePlayback:Oe,prefix:null,property:null,results:J,security:null,unselectable:null},space:"html",transform:Cz}),ake=Hc({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:fr,accentHeight:J,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:J,amplitude:J,arabicForm:null,ascent:J,attributeName:null,attributeType:null,azimuth:J,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:J,by:null,calcMode:null,capHeight:J,className:et,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:J,diffuseConstant:J,direction:null,display:null,dur:null,divisor:J,dominantBaseline:null,download:Oe,dx:null,dy:null,edgeMode:null,editable:null,elevation:J,enableBackground:null,end:null,event:null,exponent:J,externalResourcesRequired:null,fill:null,fillOpacity:J,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ku,g2:ku,glyphName:ku,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:J,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:J,horizOriginX:J,horizOriginY:J,id:null,ideographic:J,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:J,k:J,k1:J,k2:J,k3:J,k4:J,kernelMatrix:fr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:J,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:J,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:J,overlineThickness:J,paintOrder:null,panose1:null,path:null,pathLength:J,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:et,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:J,pointsAtY:J,pointsAtZ:J,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:fr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:fr,rev:fr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:fr,requiredFeatures:fr,requiredFonts:fr,requiredFormats:fr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:J,specularExponent:J,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:J,strikethroughThickness:J,string:null,stroke:null,strokeDashArray:fr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:J,strokeOpacity:J,strokeWidth:null,style:null,surfaceScale:J,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:fr,tabIndex:J,tableValues:null,target:null,targetX:J,targetY:J,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:fr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:J,underlineThickness:J,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:J,values:null,vAlphabetic:J,vMathematical:J,vectorEffect:null,vHanging:J,vIdeographic:J,version:null,vertAdvY:J,vertOriginX:J,vertOriginY:J,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:J,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Oz}),Az=Hc({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Pz=Hc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Cz}),Ez=Hc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),lke={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},uke=/[A-Z]/g,wI=/-[a-z]/g,cke=/^data[-\w.:]+$/i;function fke(e,t){const n=kk(t);let r=t,i=ir;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&cke.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(wI,dke);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!wI.test(o)){let s=o.replace(uke,hke);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=rP}return new i(r,t)}function hke(e){return"-"+e.toLowerCase()}function dke(e){return e.charAt(1).toUpperCase()}const pke=Sz([kz,ske,Az,Pz,Ez],"html"),iP=Sz([kz,ake,Az,Pz,Ez],"svg");function mke(e){return e.join(" ").trim()}var oP={},SI=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,gke=/\n/g,yke=/^\s*/,vke=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,bke=/^:\s*/,xke=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,wke=/^[;\s]*/,Ske=/^\s+|\s+$/g,kke=`
|
|
363
|
-
`,kI="/",OI="*",da="",Oke="comment",Cke="declaration";function Ake(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(p){var m=p.match(gke);m&&(n+=m.length);var v=p.lastIndexOf(kke);r=~v?p.length-v:r+p.length}function o(){var p={line:n,column:r};return function(m){return m.position=new s(p),u(),m}}function s(p){this.start=p,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(p){var m=new Error(t.source+":"+n+":"+r+": "+p);if(m.reason=p,m.filename=t.source,m.line=n,m.column=r,m.source=e,!t.silent)throw m}function l(p){var m=p.exec(e);if(m){var v=m[0];return i(v),e=e.slice(v.length),m}}function u(){l(yke)}function c(p){var m;for(p=p||[];m=f();)m!==!1&&p.push(m);return p}function f(){var p=o();if(!(kI!=e.charAt(0)||OI!=e.charAt(1))){for(var m=2;da!=e.charAt(m)&&(OI!=e.charAt(m)||kI!=e.charAt(m+1));)++m;if(m+=2,da===e.charAt(m-1))return a("End of comment missing");var v=e.slice(2,m-2);return r+=2,i(v),e=e.slice(m),r+=2,p({type:Oke,comment:v})}}function h(){var p=o(),m=l(vke);if(m){if(f(),!l(bke))return a("property missing ':'");var v=l(xke),b=p({type:Cke,property:CI(m[0].replace(SI,da)),value:v?CI(v[0].replace(SI,da)):da});return l(wke),b}}function d(){var p=[];c(p);for(var m;m=h();)m!==!1&&(p.push(m),c(p));return p}return u(),d()}function CI(e){return e?e.replace(Ske,da):da}var Pke=Ake,Eke=ts&&ts.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(oP,"__esModule",{value:!0});oP.default=_ke;const Tke=Eke(Pke);function _ke(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,Tke.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:s,value:a}=o;i?t(s,a,o):a&&(n=n||{},n[s]=a)}),n}var Y0={};Object.defineProperty(Y0,"__esModule",{value:!0});Y0.camelCase=void 0;var jke=/^--[a-zA-Z0-9_-]+$/,Mke=/-([a-z])/g,Ike=/^[^-]+$/,Nke=/^-(webkit|moz|ms|o|khtml)-/,Rke=/^-(ms)-/,Dke=function(e){return!e||Ike.test(e)||jke.test(e)},Lke=function(e,t){return t.toUpperCase()},AI=function(e,t){return"".concat(t,"-")},$ke=function(e,t){return t===void 0&&(t={}),Dke(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Rke,AI):e=e.replace(Nke,AI),e.replace(Mke,Lke))};Y0.camelCase=$ke;var Bke=ts&&ts.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Fke=Bke(oP),zke=Y0;function Ak(e,t){var n={};return!e||typeof e!="string"||(0,Fke.default)(e,function(r,i){r&&i&&(n[(0,zke.camelCase)(r,t)]=i)}),n}Ak.default=Ak;var Wke=Ak;const Uke=ze(Wke),Tz=_z("end"),sP=_z("start");function _z(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Hke(e){const t=sP(e),n=Tz(e);if(t&&n)return{start:t,end:n}}function ih(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?PI(e.position):"start"in e||"end"in e?PI(e):"line"in e||"column"in e?Pk(e):""}function Pk(e){return EI(e&&e.line)+":"+EI(e&&e.column)}function PI(e){return Pk(e&&e.start)+"-"+Pk(e&&e.end)}function EI(e){return e&&typeof e=="number"?e:1}class wn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=ih(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}wn.prototype.file="";wn.prototype.name="";wn.prototype.reason="";wn.prototype.message="";wn.prototype.stack="";wn.prototype.column=void 0;wn.prototype.line=void 0;wn.prototype.ancestors=void 0;wn.prototype.cause=void 0;wn.prototype.fatal=void 0;wn.prototype.place=void 0;wn.prototype.ruleId=void 0;wn.prototype.source=void 0;const aP={}.hasOwnProperty,Vke=new Map,qke=/[A-Z]/g,Kke=new Set(["table","tbody","thead","tfoot","tr"]),Gke=new Set(["td","th"]),jz="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Qke(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=rOe(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=nOe(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?iP:pke,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Mz(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Mz(e,t,n){if(t.type==="element")return Xke(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Yke(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Jke(e,t,n);if(t.type==="mdxjsEsm")return Zke(e,t);if(t.type==="root")return eOe(e,t,n);if(t.type==="text")return tOe(e,t)}function Xke(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=iP,e.schema=i),e.ancestors.push(t);const o=Nz(e,t.tagName,!1),s=iOe(e,t);let a=uP(e,t);return Kke.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!ike(l):!0})),Iz(e,s,o,t),lP(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function Yke(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}kd(e,t.position)}function Zke(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);kd(e,t.position)}function Jke(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=iP,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Nz(e,t.name,!0),s=oOe(e,t),a=uP(e,t);return Iz(e,s,o,t),lP(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function eOe(e,t,n){const r={};return lP(r,uP(e,t)),e.create(t,e.Fragment,r,n)}function tOe(e,t){return t.value}function Iz(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function lP(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function nOe(e,t,n){return r;function r(i,o,s,a){const u=Array.isArray(s.children)?n:t;return a?u(o,s,a):u(o,s)}}function rOe(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=sP(r);return t(i,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function iOe(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&aP.call(t.properties,i)){const o=sOe(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&Gke.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function oOe(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else kd(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else kd(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function uP(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Vke;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const u=i.get(l)||0;s=l+"-"+u,i.set(l,u+1)}}const a=Mz(e,o,s);a!==void 0&&n.push(a)}return n}function sOe(e,t,n){const r=fke(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?JSe(n):mke(n)),r.property==="style"){let i=typeof n=="object"?n:aOe(e,String(n));return e.stylePropertyNameCase==="css"&&(i=lOe(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?lke[r.property]||r.property:r.attribute,n]}}function aOe(e,t){try{return Uke(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new wn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=jz+"#cannot-parse-style-attribute",i}}function Nz(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=vI(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=vI(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return aP.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);kd(e)}function kd(e,t){const n=new wn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=jz+"#cannot-handle-mdx-estrees-without-createevaluater",n}function lOe(e){const t={};let n;for(n in e)aP.call(e,n)&&(t[uOe(n)]=e[n]);return t}function uOe(e){let t=e.replace(qke,cOe);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function cOe(e){return"-"+e.toLowerCase()}const Ux={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},fOe={};function hOe(e,t){const n=fOe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Rz(e,r,i)}function Rz(e,t,n){if(dOe(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return TI(e.children,t,n)}return Array.isArray(e)?TI(e,t,n):""}function TI(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Rz(e[i],t,n);return r.join("")}function dOe(e){return!!(e&&typeof e=="object")}const _I=document.createElement("i");function cP(e){const t="&"+e+";";_I.innerHTML=t;const n=_I.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Xi(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function Lr(e,t){return e.length>0?(Xi(e,e.length,0,t),e):t}const jI={}.hasOwnProperty;function pOe(e){const t={};let n=-1;for(;++n<e.length;)mOe(t,e[n]);return t}function mOe(e,t){let n;for(n in t){const i=(jI.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){jI.call(i,s)||(i[s]=[]);const a=o[s];gOe(i[s],Array.isArray(a)?a:a?[a]:[])}}}function gOe(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Xi(e,0,0,r)}function Dz(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Ou(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Mi=Ks(/[A-Za-z]/),xr=Ks(/[\dA-Za-z]/),yOe=Ks(/[#-'*+\--9=?A-Z^-~]/);function Ek(e){return e!==null&&(e<32||e===127)}const Tk=Ks(/\d/),vOe=Ks(/[\dA-Fa-f]/),bOe=Ks(/[!-/:-@[-`{-~]/);function ye(e){return e!==null&&e<-2}function Jn(e){return e!==null&&(e<0||e===32)}function Fe(e){return e===-2||e===-1||e===32}const xOe=Ks(/\p{P}|\p{S}/u),wOe=Ks(/\s/);function Ks(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Vc(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&xr(e.charCodeAt(n+1))&&xr(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ot(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return Fe(l)?(e.enter(n),a(l)):t(l)}function a(l){return Fe(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}const SOe={tokenize:kOe};function kOe(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ot(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return ye(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const OOe={tokenize:COe},MI={tokenize:AOe};function COe(e){const t=this,n=[];let r=0,i,o,s;return a;function a(x){if(r<n.length){const k=n[r];return t.containerState=k[1],e.attempt(k[0].continuation,l,u)(x)}return u(x)}function l(x){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&y();const k=t.events.length;let w=k,S;for(;w--;)if(t.events[w][0]==="exit"&&t.events[w][1].type==="chunkFlow"){S=t.events[w][1].end;break}b(r);let O=k;for(;O<t.events.length;)t.events[O][1].end={...S},O++;return Xi(t.events,w+1,0,t.events.slice(k)),t.events.length=O,u(x)}return a(x)}function u(x){if(r===n.length){if(!i)return h(x);if(i.currentConstruct&&i.currentConstruct.concrete)return p(x);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(MI,c,f)(x)}function c(x){return i&&y(),b(r),h(x)}function f(x){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,p(x)}function h(x){return t.containerState={},e.attempt(MI,d,p)(x)}function d(x){return r++,n.push([t.currentConstruct,t.containerState]),h(x)}function p(x){if(x===null){i&&y(),b(0),e.consume(x);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),m(x)}function m(x){if(x===null){v(e.exit("chunkFlow"),!0),b(0),e.consume(x);return}return ye(x)?(e.consume(x),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(x),m)}function v(x,k){const w=t.sliceStream(x);if(k&&w.push(null),x.previous=o,o&&(o.next=x),o=x,i.defineSkip(x.start),i.write(w),t.parser.lazy[x.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<s&&(!i.events[S][1].end||i.events[S][1].end.offset>s))return;const O=t.events.length;let A=O,P,M;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){if(P){M=t.events[A][1].end;break}P=!0}for(b(r),S=O;S<t.events.length;)t.events[S][1].end={...M},S++;Xi(t.events,A+1,0,t.events.slice(O)),t.events.length=S}}function b(x){let k=n.length;for(;k-- >x;){const w=n[k];t.containerState=w[1],w[0].exit.call(t,e)}n.length=x}function y(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function AOe(e,t,n){return ot(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function II(e){if(e===null||Jn(e)||wOe(e))return 1;if(xOe(e))return 2}function fP(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const _k={name:"attention",resolveAll:POe,tokenize:EOe};function POe(e,t){let n=-1,r,i,o,s,a,l,u,c;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},h={...e[n][1].start};NI(f,-l),NI(h,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Lr(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Lr(u,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),u=Lr(u,fP(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Lr(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=Lr(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,Xi(e,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function EOe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=II(r);let o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;const u=e.exit("attentionSequence"),c=II(l),f=!c||c===2&&i||n.includes(l),h=!i||i===2&&c||n.includes(r);return u._open=!!(o===42?f:f&&(i||!h)),u._close=!!(o===42?h:h&&(c||!f)),t(l)}}function NI(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const TOe={name:"autolink",tokenize:_Oe};function _Oe(e,t,n){let r=0;return i;function i(d){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(d){return Mi(d)?(e.consume(d),s):d===64?n(d):u(d)}function s(d){return d===43||d===45||d===46||xr(d)?(r=1,a(d)):u(d)}function a(d){return d===58?(e.consume(d),r=0,l):(d===43||d===45||d===46||xr(d))&&r++<32?(e.consume(d),a):(r=0,u(d))}function l(d){return d===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):d===null||d===32||d===60||Ek(d)?n(d):(e.consume(d),l)}function u(d){return d===64?(e.consume(d),c):yOe(d)?(e.consume(d),u):n(d)}function c(d){return xr(d)?f(d):n(d)}function f(d){return d===46?(e.consume(d),r=0,c):d===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):h(d)}function h(d){if((d===45||xr(d))&&r++<63){const p=d===45?h:f;return e.consume(d),p}return n(d)}}const Z0={partial:!0,tokenize:jOe};function jOe(e,t,n){return r;function r(o){return Fe(o)?ot(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||ye(o)?t(o):n(o)}}const Lz={continuation:{tokenize:IOe},exit:NOe,name:"blockQuote",tokenize:MOe};function MOe(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return Fe(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function IOe(e,t,n){const r=this;return i;function i(s){return Fe(s)?ot(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(Lz,t,n)(s)}}function NOe(e){e.exit("blockQuote")}const $z={name:"characterEscape",tokenize:ROe};function ROe(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return bOe(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Bz={name:"characterReference",tokenize:DOe};function DOe(e,t,n){const r=this;let i=0,o,s;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,s=xr,c(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=vOe,c):(e.enter("characterReferenceValue"),o=7,s=Tk,c(f))}function c(f){if(f===59&&i){const h=e.exit("characterReferenceValue");return s===xr&&!cP(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&i++<o?(e.consume(f),c):n(f)}}const RI={partial:!0,tokenize:$Oe},DI={concrete:!0,name:"codeFenced",tokenize:LOe};function LOe(e,t,n){const r=this,i={partial:!0,tokenize:w};let o=0,s=0,a;return l;function l(S){return u(S)}function u(S){const O=r.events[r.events.length-1];return o=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,a=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(S)}function c(S){return S===a?(s++,e.consume(S),c):s<3?n(S):(e.exit("codeFencedFenceSequence"),Fe(S)?ot(e,f,"whitespace")(S):f(S))}function f(S){return S===null||ye(S)?(e.exit("codeFencedFence"),r.interrupt?t(S):e.check(RI,m,k)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(S))}function h(S){return S===null||ye(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(S)):Fe(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ot(e,d,"whitespace")(S)):S===96&&S===a?n(S):(e.consume(S),h)}function d(S){return S===null||ye(S)?f(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(S))}function p(S){return S===null||ye(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(S)):S===96&&S===a?n(S):(e.consume(S),p)}function m(S){return e.attempt(i,k,v)(S)}function v(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),b}function b(S){return o>0&&Fe(S)?ot(e,y,"linePrefix",o+1)(S):y(S)}function y(S){return S===null||ye(S)?e.check(RI,m,k)(S):(e.enter("codeFlowValue"),x(S))}function x(S){return S===null||ye(S)?(e.exit("codeFlowValue"),y(S)):(e.consume(S),x)}function k(S){return e.exit("codeFenced"),t(S)}function w(S,O,A){let P=0;return M;function M(N){return S.enter("lineEnding"),S.consume(N),S.exit("lineEnding"),j}function j(N){return S.enter("codeFencedFence"),Fe(N)?ot(S,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):E(N)}function E(N){return N===a?(S.enter("codeFencedFenceSequence"),D(N)):A(N)}function D(N){return N===a?(P++,S.consume(N),D):P>=s?(S.exit("codeFencedFenceSequence"),Fe(N)?ot(S,R,"whitespace")(N):R(N)):A(N)}function R(N){return N===null||ye(N)?(S.exit("codeFencedFence"),O(N)):A(N)}}}function $Oe(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Hx={name:"codeIndented",tokenize:FOe},BOe={partial:!0,tokenize:zOe};function FOe(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),ot(e,o,"linePrefix",5)(u)}function o(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):ye(u)?e.attempt(BOe,s,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||ye(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function zOe(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):ye(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):ot(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):ye(s)?i(s):n(s)}}const WOe={name:"codeText",previous:HOe,resolve:UOe,tokenize:VOe};function UOe(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function HOe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function VOe(e,t,n){let r=0,i,o;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(o=e.enter("codeTextSequence"),i=0,c(f)):ye(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||ye(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),u)}function c(f){return f===96?(e.consume(f),i++,c):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(o.type="codeTextData",u(f))}}class qOe{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Sf(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Sf(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Sf(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Sf(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Sf(this.left,n.reverse())}}}function Sf(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Fz(e){const t={};let n=-1,r,i,o,s,a,l,u;const c=new qOe(e);for(;++n<c.length;){for(;n in t;)n=t[n];if(r=c.get(n),n&&r[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,KOe(c,n)),n=t[n],u=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=c.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},a=c.slice(i,n),a.unshift(r),c.splice(i,n-i+1,a))}}return Xi(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function KOe(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],u={};let c,f,h=-1,d=n,p=0,m=0;const v=[m];for(;d;){for(;e.get(++i)[1]!==d;);o.push(i),d._tokenizer||(c=r.sliceStream(d),d.next||c.push(null),f&&s.defineSkip(d.start),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(c),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=d,d=d.next}for(d=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(m=h+1,v.push(m),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(s.events=[],d?(d._tokenizer=void 0,d.previous=void 0):v.pop(),h=v.length;h--;){const b=a.slice(v[h],v[h+1]),y=o.pop();l.push([y,y+b.length-1]),e.splice(y,2,b)}for(l.reverse(),h=-1;++h<l.length;)u[p+l[h][0]]=p+l[h][1],p+=l[h][1]-l[h][0]-1;return u}const GOe={resolve:XOe,tokenize:YOe},QOe={partial:!0,tokenize:ZOe};function XOe(e){return Fz(e),e}function YOe(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):ye(a)?e.check(QOe,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function ZOe(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ot(e,o,"linePrefix")}function o(s){if(s===null||ye(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function zz(e,t,n,r,i,o,s,a,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return f;function f(b){return b===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(b),e.exit(o),h):b===null||b===32||b===41||Ek(b)?n(b):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),m(b))}function h(b){return b===62?(e.enter(o),e.consume(b),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),d(b))}function d(b){return b===62?(e.exit("chunkString"),e.exit(a),h(b)):b===null||b===60||ye(b)?n(b):(e.consume(b),b===92?p:d)}function p(b){return b===60||b===62||b===92?(e.consume(b),d):d(b)}function m(b){return!c&&(b===null||b===41||Jn(b))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(b)):c<u&&b===40?(e.consume(b),c++,m):b===41?(e.consume(b),c--,m):b===null||b===32||b===40||Ek(b)?n(b):(e.consume(b),b===92?v:m)}function v(b){return b===40||b===41||b===92?(e.consume(b),m):m(b)}}function Wz(e,t,n,r,i,o){const s=this;let a=0,l;return u;function u(d){return e.enter(r),e.enter(i),e.consume(d),e.exit(i),e.enter(o),c}function c(d){return a>999||d===null||d===91||d===93&&!l||d===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):d===93?(e.exit(o),e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):ye(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===null||d===91||d===93||ye(d)||a++>999?(e.exit("chunkString"),c(d)):(e.consume(d),l||(l=!Fe(d)),d===92?h:f)}function h(d){return d===91||d===92||d===93?(e.consume(d),a++,f):f(d)}}function Uz(e,t,n,r,i,o){let s;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,l):n(h)}function l(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),u(h))}function u(h){return h===s?(e.exit(o),l(s)):h===null?n(h):ye(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ot(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===s||h===null||ye(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:c)}function f(h){return h===s||h===92?(e.consume(h),c):c(h)}}function oh(e,t){let n;return r;function r(i){return ye(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Fe(i)?ot(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const JOe={name:"definition",tokenize:tCe},eCe={partial:!0,tokenize:nCe};function tCe(e,t,n){const r=this;let i;return o;function o(d){return e.enter("definition"),s(d)}function s(d){return Wz.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function a(d){return i=Ou(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),l):n(d)}function l(d){return Jn(d)?oh(e,u)(d):u(d)}function u(d){return zz(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return e.attempt(eCe,f,f)(d)}function f(d){return Fe(d)?ot(e,h,"whitespace")(d):h(d)}function h(d){return d===null||ye(d)?(e.exit("definition"),r.parser.defined.push(i),t(d)):n(d)}}function nCe(e,t,n){return r;function r(a){return Jn(a)?oh(e,i)(a):n(a)}function i(a){return Uz(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return Fe(a)?ot(e,s,"whitespace")(a):s(a)}function s(a){return a===null||ye(a)?t(a):n(a)}}const rCe={name:"hardBreakEscape",tokenize:iCe};function iCe(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return ye(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const oCe={name:"headingAtx",resolve:sCe,tokenize:aCe};function sCe(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Xi(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function aCe(e,t,n){let r=0;return i;function i(c){return e.enter("atxHeading"),o(c)}function o(c){return e.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&r++<6?(e.consume(c),s):c===null||Jn(c)?(e.exit("atxHeadingSequence"),a(c)):n(c)}function a(c){return c===35?(e.enter("atxHeadingSequence"),l(c)):c===null||ye(c)?(e.exit("atxHeading"),t(c)):Fe(c)?ot(e,a,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function l(c){return c===35?(e.consume(c),l):(e.exit("atxHeadingSequence"),a(c))}function u(c){return c===null||c===35||Jn(c)?(e.exit("atxHeadingText"),a(c)):(e.consume(c),u)}}const lCe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],LI=["pre","script","style","textarea"],uCe={concrete:!0,name:"htmlFlow",resolveTo:hCe,tokenize:dCe},cCe={partial:!0,tokenize:mCe},fCe={partial:!0,tokenize:pCe};function hCe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function dCe(e,t,n){const r=this;let i,o,s,a,l;return u;function u(_){return c(_)}function c(_){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(_),f}function f(_){return _===33?(e.consume(_),h):_===47?(e.consume(_),o=!0,m):_===63?(e.consume(_),i=3,r.interrupt?t:T):Mi(_)?(e.consume(_),s=String.fromCharCode(_),v):n(_)}function h(_){return _===45?(e.consume(_),i=2,d):_===91?(e.consume(_),i=5,a=0,p):Mi(_)?(e.consume(_),i=4,r.interrupt?t:T):n(_)}function d(_){return _===45?(e.consume(_),r.interrupt?t:T):n(_)}function p(_){const K="CDATA[";return _===K.charCodeAt(a++)?(e.consume(_),a===K.length?r.interrupt?t:E:p):n(_)}function m(_){return Mi(_)?(e.consume(_),s=String.fromCharCode(_),v):n(_)}function v(_){if(_===null||_===47||_===62||Jn(_)){const K=_===47,Q=s.toLowerCase();return!K&&!o&&LI.includes(Q)?(i=1,r.interrupt?t(_):E(_)):lCe.includes(s.toLowerCase())?(i=6,K?(e.consume(_),b):r.interrupt?t(_):E(_)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(_):o?y(_):x(_))}return _===45||xr(_)?(e.consume(_),s+=String.fromCharCode(_),v):n(_)}function b(_){return _===62?(e.consume(_),r.interrupt?t:E):n(_)}function y(_){return Fe(_)?(e.consume(_),y):M(_)}function x(_){return _===47?(e.consume(_),M):_===58||_===95||Mi(_)?(e.consume(_),k):Fe(_)?(e.consume(_),x):M(_)}function k(_){return _===45||_===46||_===58||_===95||xr(_)?(e.consume(_),k):w(_)}function w(_){return _===61?(e.consume(_),S):Fe(_)?(e.consume(_),w):x(_)}function S(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),l=_,O):Fe(_)?(e.consume(_),S):A(_)}function O(_){return _===l?(e.consume(_),l=null,P):_===null||ye(_)?n(_):(e.consume(_),O)}function A(_){return _===null||_===34||_===39||_===47||_===60||_===61||_===62||_===96||Jn(_)?w(_):(e.consume(_),A)}function P(_){return _===47||_===62||Fe(_)?x(_):n(_)}function M(_){return _===62?(e.consume(_),j):n(_)}function j(_){return _===null||ye(_)?E(_):Fe(_)?(e.consume(_),j):n(_)}function E(_){return _===45&&i===2?(e.consume(_),B):_===60&&i===1?(e.consume(_),F):_===62&&i===4?(e.consume(_),q):_===63&&i===3?(e.consume(_),T):_===93&&i===5?(e.consume(_),z):ye(_)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(cCe,I,D)(_)):_===null||ye(_)?(e.exit("htmlFlowData"),D(_)):(e.consume(_),E)}function D(_){return e.check(fCe,R,I)(_)}function R(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),N}function N(_){return _===null||ye(_)?D(_):(e.enter("htmlFlowData"),E(_))}function B(_){return _===45?(e.consume(_),T):E(_)}function F(_){return _===47?(e.consume(_),s="",$):E(_)}function $(_){if(_===62){const K=s.toLowerCase();return LI.includes(K)?(e.consume(_),q):E(_)}return Mi(_)&&s.length<8?(e.consume(_),s+=String.fromCharCode(_),$):E(_)}function z(_){return _===93?(e.consume(_),T):E(_)}function T(_){return _===62?(e.consume(_),q):_===45&&i===2?(e.consume(_),T):E(_)}function q(_){return _===null||ye(_)?(e.exit("htmlFlowData"),I(_)):(e.consume(_),q)}function I(_){return e.exit("htmlFlow"),t(_)}}function pCe(e,t,n){const r=this;return i;function i(s){return ye(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function mCe(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Z0,t,n)}}const gCe={name:"htmlText",tokenize:yCe};function yCe(e,t,n){const r=this;let i,o,s;return a;function a(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),l}function l(T){return T===33?(e.consume(T),u):T===47?(e.consume(T),w):T===63?(e.consume(T),x):Mi(T)?(e.consume(T),A):n(T)}function u(T){return T===45?(e.consume(T),c):T===91?(e.consume(T),o=0,p):Mi(T)?(e.consume(T),y):n(T)}function c(T){return T===45?(e.consume(T),d):n(T)}function f(T){return T===null?n(T):T===45?(e.consume(T),h):ye(T)?(s=f,F(T)):(e.consume(T),f)}function h(T){return T===45?(e.consume(T),d):f(T)}function d(T){return T===62?B(T):T===45?h(T):f(T)}function p(T){const q="CDATA[";return T===q.charCodeAt(o++)?(e.consume(T),o===q.length?m:p):n(T)}function m(T){return T===null?n(T):T===93?(e.consume(T),v):ye(T)?(s=m,F(T)):(e.consume(T),m)}function v(T){return T===93?(e.consume(T),b):m(T)}function b(T){return T===62?B(T):T===93?(e.consume(T),b):m(T)}function y(T){return T===null||T===62?B(T):ye(T)?(s=y,F(T)):(e.consume(T),y)}function x(T){return T===null?n(T):T===63?(e.consume(T),k):ye(T)?(s=x,F(T)):(e.consume(T),x)}function k(T){return T===62?B(T):x(T)}function w(T){return Mi(T)?(e.consume(T),S):n(T)}function S(T){return T===45||xr(T)?(e.consume(T),S):O(T)}function O(T){return ye(T)?(s=O,F(T)):Fe(T)?(e.consume(T),O):B(T)}function A(T){return T===45||xr(T)?(e.consume(T),A):T===47||T===62||Jn(T)?P(T):n(T)}function P(T){return T===47?(e.consume(T),B):T===58||T===95||Mi(T)?(e.consume(T),M):ye(T)?(s=P,F(T)):Fe(T)?(e.consume(T),P):B(T)}function M(T){return T===45||T===46||T===58||T===95||xr(T)?(e.consume(T),M):j(T)}function j(T){return T===61?(e.consume(T),E):ye(T)?(s=j,F(T)):Fe(T)?(e.consume(T),j):P(T)}function E(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),i=T,D):ye(T)?(s=E,F(T)):Fe(T)?(e.consume(T),E):(e.consume(T),R)}function D(T){return T===i?(e.consume(T),i=void 0,N):T===null?n(T):ye(T)?(s=D,F(T)):(e.consume(T),D)}function R(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||Jn(T)?P(T):(e.consume(T),R)}function N(T){return T===47||T===62||Jn(T)?P(T):n(T)}function B(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function F(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),$}function $(T){return Fe(T)?ot(e,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):z(T)}function z(T){return e.enter("htmlTextData"),s(T)}}const hP={name:"labelEnd",resolveAll:wCe,resolveTo:SCe,tokenize:kCe},vCe={tokenize:OCe},bCe={tokenize:CCe},xCe={tokenize:ACe};function wCe(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Xi(e,0,e.length,n),e}function SCe(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},c={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",u,t]],a=Lr(a,e.slice(o+1,o+r+3)),a=Lr(a,[["enter",c,t]]),a=Lr(a,fP(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=Lr(a,[["exit",c,t],e[s-2],e[s-1],["exit",u,t]]),a=Lr(a,e.slice(s+1)),a=Lr(a,[["exit",l,t]]),Xi(e,o,e.length,a),e}function kCe(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(h){return o?o._inactive?f(h):(s=r.parser.defined.includes(Ou(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(vCe,c,s?c:f)(h):h===91?e.attempt(bCe,c,s?u:f)(h):s?c(h):f(h)}function u(h){return e.attempt(xCe,c,f)(h)}function c(h){return t(h)}function f(h){return o._balanced=!0,n(h)}}function OCe(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return Jn(f)?oh(e,o)(f):o(f)}function o(f){return f===41?c(f):zz(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return Jn(f)?oh(e,l)(f):c(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?Uz(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function u(f){return Jn(f)?oh(e,c)(f):c(f)}function c(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function CCe(e,t,n){const r=this;return i;function i(a){return Wz.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(Ou(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function ACe(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const PCe={name:"labelStartImage",resolveAll:hP.resolveAll,tokenize:ECe};function ECe(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const TCe={name:"labelStartLink",resolveAll:hP.resolveAll,tokenize:_Ce};function _Ce(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const Vx={name:"lineEnding",tokenize:jCe};function jCe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ot(e,t,"linePrefix")}}const Zm={name:"thematicBreak",tokenize:MCe};function MCe(e,t,n){let r=0,i;return o;function o(u){return e.enter("thematicBreak"),s(u)}function s(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||ye(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),Fe(u)?ot(e,a,"whitespace")(u):a(u))}}const Bn={continuation:{tokenize:DCe},exit:$Ce,name:"list",tokenize:RCe},ICe={partial:!0,tokenize:BCe},NCe={partial:!0,tokenize:LCe};function RCe(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(d){const p=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:Tk(d)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(Zm,n,u)(d):u(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(d)}return n(d)}function l(d){return Tk(d)&&++s<10?(e.consume(d),l):(!r.interrupt||s<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),u(d)):n(d)}function u(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check(Z0,r.interrupt?n:c,e.attempt(ICe,h,f))}function c(d){return r.containerState.initialBlankLine=!0,o++,h(d)}function f(d){return Fe(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),h):n(d)}function h(d){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function DCe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Z0,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ot(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!Fe(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(NCe,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,ot(e,e.attempt(Bn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function LCe(e,t,n){const r=this;return ot(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function $Ce(e){e.exit(this.containerState.type)}function BCe(e,t,n){const r=this;return ot(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!Fe(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const $I={name:"setextUnderline",resolveTo:FCe,tokenize:zCe};function FCe(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function zCe(e,t,n){const r=this;let i;return o;function o(u){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),Fe(u)?ot(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ye(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const WCe={tokenize:UCe};function UCe(e){const t=this,n=e.attempt(Z0,r,e.attempt(this.parser.constructs.flowInitial,i,ot(e,e.attempt(this.parser.constructs.flow,i,e.attempt(GOe,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const HCe={resolveAll:Vz()},VCe=Hz("string"),qCe=Hz("text");function Hz(e){return{resolveAll:Vz(e==="text"?KCe:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(c){return u(c)?o(c):a(c)}function a(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),o(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;const f=i[c];let h=-1;if(f)for(;++h<f.length;){const d=f[h];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function Vz(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function KCe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,a=0,l;for(;o--;){const u=i[o];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(u===-2)l=!0,a++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const u={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const GCe={42:Bn,43:Bn,45:Bn,48:Bn,49:Bn,50:Bn,51:Bn,52:Bn,53:Bn,54:Bn,55:Bn,56:Bn,57:Bn,62:Lz},QCe={91:JOe},XCe={[-2]:Hx,[-1]:Hx,32:Hx},YCe={35:oCe,42:Zm,45:[$I,Zm],60:uCe,61:$I,95:Zm,96:DI,126:DI},ZCe={38:Bz,92:$z},JCe={[-5]:Vx,[-4]:Vx,[-3]:Vx,33:PCe,38:Bz,42:_k,60:[TOe,gCe],91:TCe,92:[rCe,$z],93:hP,95:_k,96:WOe},eAe={null:[_k,HCe]},tAe={null:[42,95]},nAe={null:[]},rAe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:tAe,contentInitial:QCe,disable:nAe,document:GCe,flow:YCe,flowInitial:XCe,insideSpan:eAe,string:ZCe,text:JCe},Symbol.toStringTag,{value:"Module"}));function iAe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],a=[];const l={attempt:O(w),check:O(S),consume:y,enter:x,exit:k,interrupt:O(S,{interrupt:!0})},u={code:null,containerState:{},defineSkip:m,events:[],now:p,parser:e,previous:null,sliceSerialize:h,sliceStream:d,write:f};let c=t.tokenize.call(u,l);return t.resolveAll&&o.push(t),u;function f(j){return s=Lr(s,j),v(),s[s.length-1]!==null?[]:(A(t,0),u.events=fP(o,u.events,u),u.events)}function h(j,E){return sAe(d(j),E)}function d(j){return oAe(s,j)}function p(){const{_bufferIndex:j,_index:E,line:D,column:R,offset:N}=r;return{_bufferIndex:j,_index:E,line:D,column:R,offset:N}}function m(j){i[j.line]=j.column,M()}function v(){let j;for(;r._index<s.length;){const E=s[r._index];if(typeof E=="string")for(j=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===j&&r._bufferIndex<E.length;)b(E.charCodeAt(r._bufferIndex));else b(E)}}function b(j){c=c(j)}function y(j){ye(j)?(r.line++,r.column=1,r.offset+=j===-3?2:1,M()):j!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=j}function x(j,E){const D=E||{};return D.type=j,D.start=p(),u.events.push(["enter",D,u]),a.push(D),D}function k(j){const E=a.pop();return E.end=p(),u.events.push(["exit",E,u]),E}function w(j,E){A(j,E.from)}function S(j,E){E.restore()}function O(j,E){return D;function D(R,N,B){let F,$,z,T;return Array.isArray(R)?I(R):"tokenize"in R?I([R]):q(R);function q(te){return he;function he(ve){const X=ve!==null&&te[ve],ue=ve!==null&&te.null,ge=[...Array.isArray(X)?X:X?[X]:[],...Array.isArray(ue)?ue:ue?[ue]:[]];return I(ge)(ve)}}function I(te){return F=te,$=0,te.length===0?B:_(te[$])}function _(te){return he;function he(ve){return T=P(),z=te,te.partial||(u.currentConstruct=te),te.name&&u.parser.constructs.disable.null.includes(te.name)?Q():te.tokenize.call(E?Object.assign(Object.create(u),E):u,l,K,Q)(ve)}}function K(te){return j(z,T),N}function Q(te){return T.restore(),++$<F.length?_(F[$]):B}}}function A(j,E){j.resolveAll&&!o.includes(j)&&o.push(j),j.resolve&&Xi(u.events,E,u.events.length-E,j.resolve(u.events.slice(E),u)),j.resolveTo&&(u.events=j.resolveTo(u.events,u))}function P(){const j=p(),E=u.previous,D=u.currentConstruct,R=u.events.length,N=Array.from(a);return{from:R,restore:B};function B(){r=j,u.previous=E,u.currentConstruct=D,u.events.length=R,a=N,M()}}function M(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function oAe(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function sAe(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
|
364
|
-
`;break}case-3:{s=`\r
|
|
365
|
-
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function aAe(e){const r={constructs:pOe([rAe,...(e||{}).extensions||[]]),content:i(SOe),defined:[],document:i(OOe),flow:i(WCe),lazy:{},string:i(VCe),text:i(qCe)};return r;function i(o){return s;function s(a){return iAe(r,o,a)}}}function lAe(e){for(;!Fz(e););return e}const BI=/[\0\t\n\r]/g;function uAe(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const l=[];let u,c,f,h,d;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),f=0,t="",n&&(o.charCodeAt(0)===65279&&f++,n=void 0);f<o.length;){if(BI.lastIndex=f,u=BI.exec(o),h=u&&u.index!==void 0?u.index:o.length,d=o.charCodeAt(h),!u){t=o.slice(f);break}if(d===10&&f===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<h&&(l.push(o.slice(f,h)),e+=h-f),d){case 0:{l.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,l.push(-2);e++<c;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const cAe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function fAe(e){return e.replace(cAe,hAe)}function hAe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Dz(n.slice(o?2:1),o?16:10)}return cP(n)||e}const qz={}.hasOwnProperty;function dAe(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),pAe(n)(lAe(aAe(n).document().write(uAe()(e,t,!0))))}function pAe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(or),autolinkProtocol:P,autolinkEmail:P,atxHeading:o(dt),blockQuote:o(ue),characterEscape:P,characterReference:P,codeFenced:o(ge),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(ge,s),codeText:o(Y,s),codeTextData:P,data:P,codeFlowValue:P,definition:o(Qe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(Pe),hardBreakEscape:o(at),hardBreakTrailing:o(at),htmlFlow:o(Mt,s),htmlFlowData:P,htmlText:o(Mt,s),htmlTextData:P,image:o(nn),label:s,link:o(or),listItem:o(Jr),listItemValue:h,listOrdered:o(Cn,f),listUnordered:o(Cn),paragraph:o(jr),reference:_,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(dt),strong:o(Ys),thematicBreak:o(Ue)},exit:{atxHeading:l(),atxHeadingSequence:w,autolink:l(),autolinkEmail:X,autolinkProtocol:ve,blockQuote:l(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:Q,characterReferenceMarkerNumeric:Q,characterReferenceValue:te,characterReference:he,codeFenced:l(v),codeFencedFence:m,codeFencedFenceInfo:d,codeFencedFenceMeta:p,codeFlowValue:M,codeIndented:l(b),codeText:l(N),codeTextData:M,data:M,definition:l(),definitionDestinationString:k,definitionLabelString:y,definitionTitleString:x,emphasis:l(),hardBreakEscape:l(E),hardBreakTrailing:l(E),htmlFlow:l(D),htmlFlowData:M,htmlText:l(R),htmlTextData:M,image:l(F),label:z,labelText:$,lineEnding:j,link:l(B),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:K,resourceDestinationString:T,resourceTitleString:q,resource:I,setextHeading:l(A),setextHeadingLineSequence:O,setextHeadingText:S,strong:l(),thematicBreak:l()}};Kz(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(U){let ee={type:"root",children:[]};const be={stack:[ee],tokenStack:[],config:t,enter:a,exit:u,buffer:s,resume:c,data:n},Ie=[];let Xe=-1;for(;++Xe<U.length;)if(U[Xe][1].type==="listOrdered"||U[Xe][1].type==="listUnordered")if(U[Xe][0]==="enter")Ie.push(Xe);else{const ei=Ie.pop();Xe=i(U,ei,Xe)}for(Xe=-1;++Xe<U.length;){const ei=t[U[Xe][0]];qz.call(ei,U[Xe][1].type)&&ei[U[Xe][1].type].call(Object.assign({sliceSerialize:U[Xe][2].sliceSerialize},be),U[Xe][1])}if(be.tokenStack.length>0){const ei=be.tokenStack[be.tokenStack.length-1];(ei[1]||FI).call(be,void 0,ei[0])}for(ee.position={start:Ho(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:Ho(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},Xe=-1;++Xe<t.transforms.length;)ee=t.transforms[Xe](ee)||ee;return ee}function i(U,ee,be){let Ie=ee-1,Xe=-1,ei=!1,Js,to,Qc,Xc;for(;++Ie<=be;){const sr=U[Ie];switch(sr[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{sr[0]==="enter"?Xe++:Xe--,Xc=void 0;break}case"lineEndingBlank":{sr[0]==="enter"&&(Js&&!Xc&&!Xe&&!Qc&&(Qc=Ie),Xc=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Xc=void 0}if(!Xe&&sr[0]==="enter"&&sr[1].type==="listItemPrefix"||Xe===-1&&sr[0]==="exit"&&(sr[1].type==="listUnordered"||sr[1].type==="listOrdered")){if(Js){let xl=Ie;for(to=void 0;xl--;){const no=U[xl];if(no[1].type==="lineEnding"||no[1].type==="lineEndingBlank"){if(no[0]==="exit")continue;to&&(U[to][1].type="lineEndingBlank",ei=!0),no[1].type="lineEnding",to=xl}else if(!(no[1].type==="linePrefix"||no[1].type==="blockQuotePrefix"||no[1].type==="blockQuotePrefixWhitespace"||no[1].type==="blockQuoteMarker"||no[1].type==="listItemIndent"))break}Qc&&(!to||Qc<to)&&(Js._spread=!0),Js.end=Object.assign({},to?U[to][1].start:sr[1].end),U.splice(to||Ie,0,["exit",Js,sr[2]]),Ie++,be++}if(sr[1].type==="listItemPrefix"){const xl={type:"listItem",_spread:!1,start:Object.assign({},sr[1].start),end:void 0};Js=xl,U.splice(Ie,0,["enter",xl,sr[2]]),Ie++,be++,Qc=void 0,Xc=!0}}}return U[ee][1]._spread=ei,be}function o(U,ee){return be;function be(Ie){a.call(this,U(Ie),Ie),ee&&ee.call(this,Ie)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(U,ee,be){this.stack[this.stack.length-1].children.push(U),this.stack.push(U),this.tokenStack.push([ee,be||void 0]),U.position={start:Ho(ee.start),end:void 0}}function l(U){return ee;function ee(be){U&&U.call(this,be),u.call(this,be)}}function u(U,ee){const be=this.stack.pop(),Ie=this.tokenStack.pop();if(Ie)Ie[0].type!==U.type&&(ee?ee.call(this,U,Ie[0]):(Ie[1]||FI).call(this,U,Ie[0]));else throw new Error("Cannot close `"+U.type+"` ("+ih({start:U.start,end:U.end})+"): it’s not open");be.position.end=Ho(U.end)}function c(){return hOe(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(U){if(this.data.expectingFirstListItemValue){const ee=this.stack[this.stack.length-2];ee.start=Number.parseInt(this.sliceSerialize(U),10),this.data.expectingFirstListItemValue=void 0}}function d(){const U=this.resume(),ee=this.stack[this.stack.length-1];ee.lang=U}function p(){const U=this.resume(),ee=this.stack[this.stack.length-1];ee.meta=U}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const U=this.resume(),ee=this.stack[this.stack.length-1];ee.value=U.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const U=this.resume(),ee=this.stack[this.stack.length-1];ee.value=U.replace(/(\r?\n|\r)$/g,"")}function y(U){const ee=this.resume(),be=this.stack[this.stack.length-1];be.label=ee,be.identifier=Ou(this.sliceSerialize(U)).toLowerCase()}function x(){const U=this.resume(),ee=this.stack[this.stack.length-1];ee.title=U}function k(){const U=this.resume(),ee=this.stack[this.stack.length-1];ee.url=U}function w(U){const ee=this.stack[this.stack.length-1];if(!ee.depth){const be=this.sliceSerialize(U).length;ee.depth=be}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function O(U){const ee=this.stack[this.stack.length-1];ee.depth=this.sliceSerialize(U).codePointAt(0)===61?1:2}function A(){this.data.setextHeadingSlurpLineEnding=void 0}function P(U){const be=this.stack[this.stack.length-1].children;let Ie=be[be.length-1];(!Ie||Ie.type!=="text")&&(Ie=Zs(),Ie.position={start:Ho(U.start),end:void 0},be.push(Ie)),this.stack.push(Ie)}function M(U){const ee=this.stack.pop();ee.value+=this.sliceSerialize(U),ee.position.end=Ho(U.end)}function j(U){const ee=this.stack[this.stack.length-1];if(this.data.atHardBreak){const be=ee.children[ee.children.length-1];be.position.end=Ho(U.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ee.type)&&(P.call(this,U),M.call(this,U))}function E(){this.data.atHardBreak=!0}function D(){const U=this.resume(),ee=this.stack[this.stack.length-1];ee.value=U}function R(){const U=this.resume(),ee=this.stack[this.stack.length-1];ee.value=U}function N(){const U=this.resume(),ee=this.stack[this.stack.length-1];ee.value=U}function B(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const ee=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=ee,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function F(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const ee=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=ee,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function $(U){const ee=this.sliceSerialize(U),be=this.stack[this.stack.length-2];be.label=fAe(ee),be.identifier=Ou(ee).toLowerCase()}function z(){const U=this.stack[this.stack.length-1],ee=this.resume(),be=this.stack[this.stack.length-1];if(this.data.inReference=!0,be.type==="link"){const Ie=U.children;be.children=Ie}else be.alt=ee}function T(){const U=this.resume(),ee=this.stack[this.stack.length-1];ee.url=U}function q(){const U=this.resume(),ee=this.stack[this.stack.length-1];ee.title=U}function I(){this.data.inReference=void 0}function _(){this.data.referenceType="collapsed"}function K(U){const ee=this.resume(),be=this.stack[this.stack.length-1];be.label=ee,be.identifier=Ou(this.sliceSerialize(U)).toLowerCase(),this.data.referenceType="full"}function Q(U){this.data.characterReferenceType=U.type}function te(U){const ee=this.sliceSerialize(U),be=this.data.characterReferenceType;let Ie;be?(Ie=Dz(ee,be==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ie=cP(ee);const Xe=this.stack[this.stack.length-1];Xe.value+=Ie}function he(U){const ee=this.stack.pop();ee.position.end=Ho(U.end)}function ve(U){M.call(this,U);const ee=this.stack[this.stack.length-1];ee.url=this.sliceSerialize(U)}function X(U){M.call(this,U);const ee=this.stack[this.stack.length-1];ee.url="mailto:"+this.sliceSerialize(U)}function ue(){return{type:"blockquote",children:[]}}function ge(){return{type:"code",lang:null,meta:null,value:""}}function Y(){return{type:"inlineCode",value:""}}function Qe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Pe(){return{type:"emphasis",children:[]}}function dt(){return{type:"heading",depth:0,children:[]}}function at(){return{type:"break"}}function Mt(){return{type:"html",value:""}}function nn(){return{type:"image",title:null,url:"",alt:null}}function or(){return{type:"link",title:null,url:"",children:[]}}function Cn(U){return{type:"list",ordered:U.type==="listOrdered",start:null,spread:U._spread,children:[]}}function Jr(U){return{type:"listItem",spread:U._spread,checked:null,children:[]}}function jr(){return{type:"paragraph",children:[]}}function Ys(){return{type:"strong",children:[]}}function Zs(){return{type:"text",value:""}}function Ue(){return{type:"thematicBreak"}}}function Ho(e){return{line:e.line,column:e.column,offset:e.offset}}function Kz(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Kz(e,r):mAe(e,r)}}function mAe(e,t){let n;for(n in t)if(qz.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function FI(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ih({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ih({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ih({start:t.start,end:t.end})+") is still open")}function gAe(e){const t=this;t.parser=n;function n(r){return dAe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function yAe(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function vAe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
366
|
-
`}]}function bAe(e,t){const n=t.value?t.value+`
|
|
367
|
-
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function xAe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wAe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function SAe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Vc(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function kAe(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function OAe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Gz(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function CAe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Gz(e,t);const i={src:Vc(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function AAe(e,t){const n={src:Vc(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function PAe(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function EAe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Gz(e,t);const i={href:Vc(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function TAe(e,t){const n={href:Vc(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function _Ae(e,t,n){const r=e.all(t),i=n?jAe(n):Qz(t),o={},s=[];if(typeof t.checked=="boolean"){const c=r[0];let f;c&&c.type==="element"&&c.tagName==="p"?f=c:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const c=r[a];(i||a!==0||c.type!=="element"||c.tagName!=="p")&&s.push({type:"text",value:`
|
|
368
|
-
`}),c.type==="element"&&c.tagName==="p"&&!i?s.push(...c.children):s.push(c)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
|
|
369
|
-
`});const u={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,u),e.applyData(t,u)}function jAe(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Qz(n[r])}return t}function Qz(e){const t=e.spread;return t??e.children.length>1}function MAe(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function IAe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function NAe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function RAe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function DAe(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=sP(t.children[1]),l=Tz(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function LAe(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const u=[];for(;++l<a;){const f=t.children[l],h={},d=s?s[l]:void 0;d&&(h.align=d);let p={type:"element",tagName:o,properties:h,children:[]};f&&(p.children=e.all(f),e.patch(f,p),p=e.applyData(f,p)),u.push(p)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,c),e.applyData(t,c)}function $Ae(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const zI=9,WI=32;function BAe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(UI(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(UI(t.slice(i),i>0,!1)),o.join("")}function UI(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===zI||o===WI;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===zI||o===WI;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function FAe(e,t){const n={type:"text",value:BAe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function zAe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const WAe={blockquote:yAe,break:vAe,code:bAe,delete:xAe,emphasis:wAe,footnoteReference:SAe,heading:kAe,html:OAe,imageReference:CAe,image:AAe,inlineCode:PAe,linkReference:EAe,link:TAe,listItem:_Ae,list:MAe,paragraph:IAe,root:NAe,strong:RAe,table:DAe,tableCell:$Ae,tableRow:LAe,text:FAe,thematicBreak:zAe,toml:rm,yaml:rm,definition:rm,footnoteDefinition:rm};function rm(){}const Xz=-1,J0=0,sh=1,qy=2,dP=3,pP=4,mP=5,gP=6,Yz=7,Zz=8,HI=typeof self=="object"?self:globalThis,UAe=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case J0:case Xz:return n(s,i);case sh:{const a=n([],i);for(const l of s)a.push(r(l));return a}case qy:{const a=n({},i);for(const[l,u]of s)a[r(l)]=r(u);return a}case dP:return n(new Date(s),i);case pP:{const{source:a,flags:l}=s;return n(new RegExp(a,l),i)}case mP:{const a=n(new Map,i);for(const[l,u]of s)a.set(r(l),r(u));return a}case gP:{const a=n(new Set,i);for(const l of s)a.add(r(l));return a}case Yz:{const{name:a,message:l}=s;return n(new HI[a](l),i)}case Zz:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(new HI[o](s),i)};return r},VI=e=>UAe(new Map,e)(0),Tl="",{toString:HAe}={},{keys:VAe}=Object,kf=e=>{const t=typeof e;if(t!=="object"||!e)return[J0,t];const n=HAe.call(e).slice(8,-1);switch(n){case"Array":return[sh,Tl];case"Object":return[qy,Tl];case"Date":return[dP,Tl];case"RegExp":return[pP,Tl];case"Map":return[mP,Tl];case"Set":return[gP,Tl];case"DataView":return[sh,n]}return n.includes("Array")?[sh,n]:n.includes("Error")?[Yz,n]:[qy,n]},im=([e,t])=>e===J0&&(t==="function"||t==="symbol"),qAe=(e,t,n,r)=>{const i=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},o=s=>{if(n.has(s))return n.get(s);let[a,l]=kf(s);switch(a){case J0:{let c=s;switch(l){case"bigint":a=Zz,c=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);c=null;break;case"undefined":return i([Xz],s)}return i([a,c],s)}case sh:{if(l){let h=s;return l==="DataView"?h=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(s)),i([l,[...h]],s)}const c=[],f=i([a,c],s);for(const h of s)c.push(o(h));return f}case qy:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const c=[],f=i([a,c],s);for(const h of VAe(s))(e||!im(kf(s[h])))&&c.push([o(h),o(s[h])]);return f}case dP:return i([a,s.toISOString()],s);case pP:{const{source:c,flags:f}=s;return i([a,{source:c,flags:f}],s)}case mP:{const c=[],f=i([a,c],s);for(const[h,d]of s)(e||!(im(kf(h))||im(kf(d))))&&c.push([o(h),o(d)]);return f}case gP:{const c=[],f=i([a,c],s);for(const h of s)(e||!im(kf(h)))&&c.push(o(h));return f}}const{message:u}=s;return i([a,{name:l,message:u}],s)};return o},qI=(e,{json:t,lossy:n}={})=>{const r=[];return qAe(!(t||n),!!t,new Map,r)(e),r},Ky=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?VI(qI(e,t)):structuredClone(e):(e,t)=>VI(qI(e,t));function KAe(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function GAe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function QAe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||KAe,r=e.options.footnoteBackLabel||GAe,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const c=e.all(u),f=String(u.identifier).toUpperCase(),h=Vc(f.toLowerCase());let d=0;const p=[],m=e.footnoteCounts.get(f);for(;m!==void 0&&++d<=m;){p.length>0&&p.push({type:"text",value:" "});let y=typeof n=="string"?n:n(l,d);typeof y=="string"&&(y={type:"text",value:y}),p.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(y)?y:[y]})}const v=c[c.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const y=v.children[v.children.length-1];y&&y.type==="text"?y.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...p)}else c.push(...p);const b={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(c,!0)};e.patch(u,b),a.push(b)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Ky(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
370
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
371
|
-
`}]}}const Jz=function(e){if(e==null)return JAe;if(typeof e=="function")return eb(e);if(typeof e=="object")return Array.isArray(e)?XAe(e):YAe(e);if(typeof e=="string")return ZAe(e);throw new Error("Expected function, string, or object as test")};function XAe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Jz(e[n]);return eb(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function YAe(e){const t=e;return eb(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function ZAe(e){return eb(t);function t(n){return n&&n.type===e}}function eb(e){return t;function t(n,r,i){return!!(ePe(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function JAe(){return!0}function ePe(e){return e!==null&&typeof e=="object"&&"type"in e}const e8=[],tPe=!0,KI=!1,nPe="skip";function rPe(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=Jz(i),s=r?-1:1;a(e,void 0,[])();function a(l,u,c){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const d=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(d?"<"+d+">":""))+")"})}return h;function h(){let d=e8,p,m,v;if((!t||o(l,u,c[c.length-1]||void 0))&&(d=iPe(n(l,c)),d[0]===KI))return d;if("children"in l&&l.children){const b=l;if(b.children&&d[0]!==nPe)for(m=(r?b.children.length:-1)+s,v=c.concat(b);m>-1&&m<b.children.length;){const y=b.children[m];if(p=a(y,m,v)(),p[0]===KI)return p;m=typeof p[1]=="number"?p[1]:m+s}}return d}}}function iPe(e){return Array.isArray(e)?e:typeof e=="number"?[tPe,e]:e==null?e8:[e]}function t8(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),rPe(e,o,a,i);function a(l,u){const c=u[u.length-1],f=c?c.children.indexOf(l):void 0;return s(l,f,c)}}const jk={}.hasOwnProperty,oPe={};function sPe(e,t){const n=t||oPe,r=new Map,i=new Map,o=new Map,s={...WAe,...n.handlers},a={all:u,applyData:lPe,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:l,options:n,patch:aPe,wrap:cPe};return t8(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){const f=c.type==="definition"?r:i,h=String(c.identifier).toUpperCase();f.has(h)||f.set(h,c)}}),a;function l(c,f){const h=c.type,d=a.handlers[h];if(jk.call(a.handlers,h)&&d)return d(a,c,f);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in c){const{children:m,...v}=c,b=Ky(v);return b.children=a.all(c),b}return Ky(c)}return(a.options.unknownHandler||uPe)(a,c,f)}function u(c){const f=[];if("children"in c){const h=c.children;let d=-1;for(;++d<h.length;){const p=a.one(h[d],c);if(p){if(d&&h[d-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=GI(p.value)),!Array.isArray(p)&&p.type==="element")){const m=p.children[0];m&&m.type==="text"&&(m.value=GI(m.value))}Array.isArray(p)?f.push(...p):f.push(p)}}}return f}}function aPe(e,t){e.position&&(t.position=Hke(e))}function lPe(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,Ky(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function uPe(e,t){const n=t.data||{},r="value"in t&&!(jk.call(n,"hProperties")||jk.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function cPe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
372
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
373
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
374
|
-
`}),n}function GI(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function QI(e,t){const n=sPe(e,t),r=n.one(e,void 0),i=QAe(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
|
|
375
|
-
`},i),o}function fPe(e,t){return e&&"run"in e?async function(n,r){const i=QI(n,{file:r,...t});await e.run(i,r)}:function(n,r){return QI(n,{file:r,...e||t})}}function XI(e){if(e)throw e}var Jm=Object.prototype.hasOwnProperty,n8=Object.prototype.toString,YI=Object.defineProperty,ZI=Object.getOwnPropertyDescriptor,JI=function(t){return typeof Array.isArray=="function"?Array.isArray(t):n8.call(t)==="[object Array]"},eN=function(t){if(!t||n8.call(t)!=="[object Object]")return!1;var n=Jm.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Jm.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Jm.call(t,i)},tN=function(t,n){YI&&n.name==="__proto__"?YI(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},nN=function(t,n){if(n==="__proto__")if(Jm.call(t,n)){if(ZI)return ZI(t,n).value}else return;return t[n]},hPe=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,u=arguments.length,c=!1;for(typeof a=="boolean"&&(c=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=nN(a,n),i=nN(t,n),a!==i&&(c&&i&&(eN(i)||(o=JI(i)))?(o?(o=!1,s=r&&JI(r)?r:[]):s=r&&eN(r)?r:{},tN(a,{name:n,newValue:e(c,s,i)})):typeof i<"u"&&tN(a,{name:n,newValue:i}));return a};const qx=ze(hPe);function Mk(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function dPe(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(l,...u){const c=e[++o];let f=-1;if(l){s(l);return}for(;++f<i.length;)(u[f]===null||u[f]===void 0)&&(u[f]=i[f]);i=u,c?pPe(c,a)(...u):s(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function pPe(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(i);try{l=e.apply(this,s)}catch(u){const c=u;if(a&&n)throw c;return i(c)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const Ei={basename:mPe,dirname:gPe,extname:yPe,join:vPe,sep:"/"};function mPe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');lp(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function gPe(e){if(lp(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function yPe(e){lp(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function vPe(...e){let t=-1,n;for(;++t<e.length;)lp(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":bPe(n)}function bPe(e){lp(e);const t=e.codePointAt(0)===47;let n=xPe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function xPe(e,t){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function lp(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const wPe={cwd:SPe};function SPe(){return"/"}function Ik(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function kPe(e){if(typeof e=="string")e=new URL(e);else if(!Ik(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return OPe(e)}function OPe(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Kx=["history","path","basename","stem","extname","dirname"];class r8{constructor(t){let n;t?Ik(t)?n={path:t}:typeof t=="string"||CPe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":wPe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Kx.length;){const o=Kx[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)Kx.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ei.basename(this.path):void 0}set basename(t){Qx(t,"basename"),Gx(t,"basename"),this.path=Ei.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ei.dirname(this.path):void 0}set dirname(t){rN(this.basename,"dirname"),this.path=Ei.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ei.extname(this.path):void 0}set extname(t){if(Gx(t,"extname"),rN(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ei.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Ik(t)&&(t=kPe(t)),Qx(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ei.basename(this.path,this.extname):void 0}set stem(t){Qx(t,"stem"),Gx(t,"stem"),this.path=Ei.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new wn(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Gx(e,t){if(e&&e.includes(Ei.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ei.sep+"`")}function Qx(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function rN(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function CPe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const APe=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},PPe={}.hasOwnProperty;class yP extends APe{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=dPe()}copy(){const t=new yP;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(qx(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Zx("data",this.frozen),this.namespace[t]=n,this):PPe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Zx("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=om(t),r=this.parser||this.Parser;return Xx("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Xx("process",this.parser||this.Parser),Yx("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=om(t),l=r.parse(a);r.run(l,a,function(c,f,h){if(c||!f||!h)return u(c);const d=f,p=r.stringify(d,h);_Pe(p)?h.value=p:h.result=p,u(c,h)});function u(c,f){c||!f?s(c):o?o(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),Xx("processSync",this.parser||this.Parser),Yx("processSync",this.compiler||this.Compiler),this.process(t,i),oN("processSync","process",n),r;function i(o,s){n=!0,XI(o),r=s}}run(t,n,r){iN(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const l=om(n);i.run(t,l,u);function u(c,f,h){const d=f||t;c?a(c):s?s(d):r(void 0,d,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),oN("runSync","run",r),i;function o(s,a){XI(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=om(n),i=this.compiler||this.Compiler;return Yx("stringify",i),iN(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Zx("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[c,...f]=u;l(c,f)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(u.plugins),u.settings&&(i.settings=qx(!0,i.settings,u.settings))}function a(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){const f=u[c];o(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,c){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===u){h=f;break}if(h===-1)r.push([u,...c]);else if(c.length>0){let[d,...p]=c;const m=r[h][1];Mk(m)&&Mk(d)&&(d=qx(!0,m,d)),r[h]=[u,d,...p]}}}}const EPe=new yP().freeze();function Xx(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Yx(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Zx(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function iN(e){if(!Mk(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function oN(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function om(e){return TPe(e)?e:new r8(e)}function TPe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function _Pe(e){return typeof e=="string"||jPe(e)}function jPe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const MPe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",sN=[],aN={allowDangerousHtml:!0},IPe=/^(https?|ircs?|mailto|xmpp)$/i,NPe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function i8(e){const t=RPe(e),n=DPe(e);return LPe(t.runSync(t.parse(n),n),e)}function RPe(e){const t=e.rehypePlugins||sN,n=e.remarkPlugins||sN,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...aN}:aN;return EPe().use(gAe).use(n).use(fPe,r).use(t)}function DPe(e){const t=e.children||"",n=new r8;return typeof t=="string"&&(n.value=t),n}function LPe(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||$Pe;for(const c of NPe)Object.hasOwn(t,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+MPe+c.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),t8(e,u),Qke(e,{Fragment:g.Fragment,components:i,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0});function u(c,f,h){if(c.type==="raw"&&h&&typeof f=="number")return s?h.children.splice(f,1):h.children[f]={type:"text",value:c.value},f;if(c.type==="element"){let d;for(d in Ux)if(Object.hasOwn(Ux,d)&&Object.hasOwn(c.properties,d)){const p=c.properties[d],m=Ux[d];(m===null||m.includes(c.tagName))&&(c.properties[d]=l(String(p||""),d,c))}}if(c.type==="element"){let d=n?!n.includes(c.tagName):o?o.includes(c.tagName):!1;if(!d&&r&&typeof f=="number"&&(d=!r(c,f,h)),d&&h&&typeof f=="number")return a&&c.children?h.children.splice(f,1,...c.children):h.children.splice(f,1),f}}}function $Pe(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||IPe.test(e.slice(0,t))?e:""}var BPe=Object.create,tb=Object.defineProperty,FPe=Object.defineProperties,zPe=Object.getOwnPropertyDescriptor,WPe=Object.getOwnPropertyDescriptors,o8=Object.getOwnPropertyNames,Gy=Object.getOwnPropertySymbols,UPe=Object.getPrototypeOf,vP=Object.prototype.hasOwnProperty,s8=Object.prototype.propertyIsEnumerable,lN=(e,t,n)=>t in e?tb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Vi=(e,t)=>{for(var n in t||(t={}))vP.call(t,n)&&lN(e,n,t[n]);if(Gy)for(var n of Gy(t))s8.call(t,n)&&lN(e,n,t[n]);return e},nb=(e,t)=>FPe(e,WPe(t)),a8=(e,t)=>{var n={};for(var r in e)vP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Gy)for(var r of Gy(e))t.indexOf(r)<0&&s8.call(e,r)&&(n[r]=e[r]);return n},HPe=(e,t)=>function(){return t||(0,e[o8(e)[0]])((t={exports:{}}).exports,t),t.exports},VPe=(e,t)=>{for(var n in t)tb(e,n,{get:t[n],enumerable:!0})},qPe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of o8(t))!vP.call(e,i)&&i!==n&&tb(e,i,{get:()=>t[i],enumerable:!(r=zPe(t,i))||r.enumerable});return e},KPe=(e,t,n)=>(n=e!=null?BPe(UPe(e)):{},qPe(!e||!e.__esModule?tb(n,"default",{value:e,enumerable:!0}):n,e)),GPe=HPe({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(e,t){var n=function(){var r=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,o={},s={util:{encode:function p(m){return m instanceof a?new a(m.type,p(m.content),m.alias):Array.isArray(m)?m.map(p):m.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(p){return Object.prototype.toString.call(p).slice(8,-1)},objId:function(p){return p.__id||Object.defineProperty(p,"__id",{value:++i}),p.__id},clone:function p(m,v){v=v||{};var b,y;switch(s.util.type(m)){case"Object":if(y=s.util.objId(m),v[y])return v[y];b={},v[y]=b;for(var x in m)m.hasOwnProperty(x)&&(b[x]=p(m[x],v));return b;case"Array":return y=s.util.objId(m),v[y]?v[y]:(b=[],v[y]=b,m.forEach(function(k,w){b[w]=p(k,v)}),b);default:return m}},getLanguage:function(p){for(;p;){var m=r.exec(p.className);if(m)return m[1].toLowerCase();p=p.parentElement}return"none"},setLanguage:function(p,m){p.className=p.className.replace(RegExp(r,"gi"),""),p.classList.add("language-"+m)},isActive:function(p,m,v){for(var b="no-"+m;p;){var y=p.classList;if(y.contains(m))return!0;if(y.contains(b))return!1;p=p.parentElement}return!!v}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(p,m){var v=s.util.clone(s.languages[p]);for(var b in m)v[b]=m[b];return v},insertBefore:function(p,m,v,b){b=b||s.languages;var y=b[p],x={};for(var k in y)if(y.hasOwnProperty(k)){if(k==m)for(var w in v)v.hasOwnProperty(w)&&(x[w]=v[w]);v.hasOwnProperty(k)||(x[k]=y[k])}var S=b[p];return b[p]=x,s.languages.DFS(s.languages,function(O,A){A===S&&O!=p&&(this[O]=x)}),x},DFS:function p(m,v,b,y){y=y||{};var x=s.util.objId;for(var k in m)if(m.hasOwnProperty(k)){v.call(m,k,m[k],b||k);var w=m[k],S=s.util.type(w);S==="Object"&&!y[x(w)]?(y[x(w)]=!0,p(w,v,null,y)):S==="Array"&&!y[x(w)]&&(y[x(w)]=!0,p(w,v,k,y))}}},plugins:{},highlight:function(p,m,v){var b={code:p,grammar:m,language:v};if(s.hooks.run("before-tokenize",b),!b.grammar)throw new Error('The language "'+b.language+'" has no grammar.');return b.tokens=s.tokenize(b.code,b.grammar),s.hooks.run("after-tokenize",b),a.stringify(s.util.encode(b.tokens),b.language)},tokenize:function(p,m){var v=m.rest;if(v){for(var b in v)m[b]=v[b];delete m.rest}var y=new c;return f(y,y.head,p),u(p,y,m,y.head,0),d(y)},hooks:{all:{},add:function(p,m){var v=s.hooks.all;v[p]=v[p]||[],v[p].push(m)},run:function(p,m){var v=s.hooks.all[p];if(!(!v||!v.length))for(var b=0,y;y=v[b++];)y(m)}},Token:a};function a(p,m,v,b){this.type=p,this.content=m,this.alias=v,this.length=(b||"").length|0}a.stringify=function p(m,v){if(typeof m=="string")return m;if(Array.isArray(m)){var b="";return m.forEach(function(S){b+=p(S,v)}),b}var y={type:m.type,content:p(m.content,v),tag:"span",classes:["token",m.type],attributes:{},language:v},x=m.alias;x&&(Array.isArray(x)?Array.prototype.push.apply(y.classes,x):y.classes.push(x)),s.hooks.run("wrap",y);var k="";for(var w in y.attributes)k+=" "+w+'="'+(y.attributes[w]||"").replace(/"/g,""")+'"';return"<"+y.tag+' class="'+y.classes.join(" ")+'"'+k+">"+y.content+"</"+y.tag+">"};function l(p,m,v,b){p.lastIndex=m;var y=p.exec(v);if(y&&b&&y[1]){var x=y[1].length;y.index+=x,y[0]=y[0].slice(x)}return y}function u(p,m,v,b,y,x){for(var k in v)if(!(!v.hasOwnProperty(k)||!v[k])){var w=v[k];w=Array.isArray(w)?w:[w];for(var S=0;S<w.length;++S){if(x&&x.cause==k+","+S)return;var O=w[S],A=O.inside,P=!!O.lookbehind,M=!!O.greedy,j=O.alias;if(M&&!O.pattern.global){var E=O.pattern.toString().match(/[imsuy]*$/)[0];O.pattern=RegExp(O.pattern.source,E+"g")}for(var D=O.pattern||O,R=b.next,N=y;R!==m.tail&&!(x&&N>=x.reach);N+=R.value.length,R=R.next){var B=R.value;if(m.length>p.length)return;if(!(B instanceof a)){var F=1,$;if(M){if($=l(D,N,p,P),!$||$.index>=p.length)break;var I=$.index,z=$.index+$[0].length,T=N;for(T+=R.value.length;I>=T;)R=R.next,T+=R.value.length;if(T-=R.value.length,N=T,R.value instanceof a)continue;for(var q=R;q!==m.tail&&(T<z||typeof q.value=="string");q=q.next)F++,T+=q.value.length;F--,B=p.slice(N,T),$.index-=N}else if($=l(D,0,B,P),!$)continue;var I=$.index,_=$[0],K=B.slice(0,I),Q=B.slice(I+_.length),te=N+B.length;x&&te>x.reach&&(x.reach=te);var he=R.prev;K&&(he=f(m,he,K),N+=K.length),h(m,he,F);var ve=new a(k,A?s.tokenize(_,A):_,j,_);if(R=f(m,he,ve),Q&&f(m,R,Q),F>1){var X={cause:k+","+S,reach:te};u(p,m,v,R.prev,N,X),x&&X.reach>x.reach&&(x.reach=X.reach)}}}}}}function c(){var p={value:null,prev:null,next:null},m={value:null,prev:p,next:null};p.next=m,this.head=p,this.tail=m,this.length=0}function f(p,m,v){var b=m.next,y={value:v,prev:m,next:b};return m.next=y,b.prev=y,p.length++,y}function h(p,m,v){for(var b=m.next,y=0;y<v&&b!==p.tail;y++)b=b.next;m.next=b,b.prev=m,p.length-=y}function d(p){for(var m=[],v=p.head.next;v!==p.tail;)m.push(v.value),v=v.next;return m}return s}();t.exports=n,n.default=n}}),G=KPe(GPe());G.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},G.languages.markup.tag.inside["attr-value"].inside.entity=G.languages.markup.entity,G.languages.markup.doctype.inside["internal-subset"].inside=G.languages.markup,G.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&/,"&"))}),Object.defineProperty(G.languages.markup.tag,"addInlined",{value:function(e,r){var n={},n=(n["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:G.languages[r]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),r=(n["language-"+r]={pattern:/[\s\S]+/,inside:G.languages[r]},{});r[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:n},G.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(G.languages.markup.tag,"addAttribute",{value:function(e,t){G.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:G.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),G.languages.html=G.languages.markup,G.languages.mathml=G.languages.markup,G.languages.svg=G.languages.markup,G.languages.xml=G.languages.extend("markup",{}),G.languages.ssml=G.languages.xml,G.languages.atom=G.languages.xml,G.languages.rss=G.languages.xml,function(e){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r="(?:[^\\\\-]|"+n.source+")",r=RegExp(r+"-"+r),i={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:r,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":t,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":i}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":i}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}}(G),G.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},G.languages.javascript=G.languages.extend("clike",{"class-name":[G.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),G.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,G.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:G.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:G.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:G.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:G.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:G.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),G.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:G.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),G.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),G.languages.markup&&(G.languages.markup.tag.addInlined("script","javascript"),G.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),G.languages.js=G.languages.javascript,G.languages.actionscript=G.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),G.languages.actionscript["class-name"].alias="function",delete G.languages.actionscript.parameter,delete G.languages.actionscript["literal-property"],G.languages.markup&&G.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:G.languages.markup}}),function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(G),function(e){var t=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(t,"addSupport",{value:function(n,r){(n=typeof n=="string"?[n]:n).forEach(function(i){var o=function(f){f.inside||(f.inside={}),f.inside.rest=r},s="doc-comment";if(a=e.languages[i]){var a,l=a[s];if((l=l||(a=e.languages.insertBefore(i,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[s])instanceof RegExp&&(l=a[s]={pattern:l}),Array.isArray(l))for(var u=0,c=l.length;u<c;u++)l[u]instanceof RegExp&&(l[u]={pattern:l[u]}),o(l[u]);else o(l)}})}}),t.addSupport(["java","javascript","php"],t)}(G),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,t=(e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css,e.languages.markup);t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))}(G),function(e){var t=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,t=(e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+t.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[t,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=t,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,number:n})}(G),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+n.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function s(a,l){l=(l||"").replace(/m/g,"")+"m";var u=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return a});return RegExp(u,l)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return"(?:"+i+"|"+o+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:s(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:s(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:s(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:s(o),lookbehind:!0,greedy:!0},number:{pattern:s(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(G),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(u){return u=u.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+u+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,s=(e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+o+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+o+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(u){["url","bold","italic","strike","code-snippet"].forEach(function(c){u!==c&&(e.languages.markdown[u].inside.content.inside[c]=e.languages.markdown[c])})}),e.hooks.add("after-tokenize",function(u){u.language!=="markdown"&&u.language!=="md"||function c(f){if(f&&typeof f!="string")for(var h=0,d=f.length;h<d;h++){var p,m=f[h];m.type!=="code"?c(m.content):(p=m.content[1],m=m.content[3],p&&m&&p.type==="code-language"&&m.type==="code-block"&&typeof p.content=="string"&&(p=p.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),p="language-"+(p=(/[a-z][\w-]*/i.exec(p)||[""])[0].toLowerCase()),m.alias?typeof m.alias=="string"?m.alias=[m.alias,p]:m.alias.push(p):m.alias=[p]))}}(u.tokens)}),e.hooks.add("wrap",function(u){if(u.type==="code-block"){for(var c="",f=0,h=u.classes.length;f<h;f++){var d=u.classes[f],d=/language-(.+)/.exec(d);if(d){c=d[1];break}}var p,m=e.languages[c];m?u.content=e.highlight(function(v){return v=v.replace(s,""),v=v.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(b,y){var x;return(y=y.toLowerCase())[0]==="#"?(x=y[1]==="x"?parseInt(y.slice(2),16):Number(y.slice(1)),l(x)):a[y]||b})}(u.content),m,c):c&&c!=="none"&&e.plugins.autoloader&&(p="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),u.attributes.id=p,e.plugins.autoloader.loadLanguages(c,function(){var v=document.getElementById(p);v&&(v.innerHTML=e.highlight(v.textContent,e.languages[c],c))}))}}),RegExp(e.languages.markup.tag.pattern.source,"gi")),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(G),G.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:G.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},G.hooks.add("after-tokenize",function(e){if(e.language==="graphql")for(var t=e.tokens.filter(function(p){return typeof p!="string"&&p.type!=="comment"&&p.type!=="scalar"}),n=0;n<t.length;){var r=t[n++];if(r.type==="keyword"&&r.content==="mutation"){var i=[];if(f(["definition-mutation","punctuation"])&&c(1).content==="("){n+=2;var o=h(/^\($/,/^\)$/);if(o===-1)continue;for(;n<o;n++){var s=c(0);s.type==="variable"&&(d(s,"variable-input"),i.push(s.content))}n=o+1}if(f(["punctuation","property-query"])&&c(0).content==="{"&&(n++,d(c(0),"property-mutation"),0<i.length)){var a=h(/^\{$/,/^\}$/);if(a!==-1)for(var l=n;l<a;l++){var u=t[l];u.type==="variable"&&0<=i.indexOf(u.content)&&d(u,"variable-input")}}}}function c(p){return t[n+p]}function f(p,m){m=m||0;for(var v=0;v<p.length;v++){var b=c(v+m);if(!b||b.type!==p[v])return}return 1}function h(p,m){for(var v=1,b=n;b<t.length;b++){var y=t[b],x=y.content;if(y.type==="punctuation"&&typeof x=="string"){if(p.test(x))v++;else if(m.test(x)&&--v===0)return b}}return-1}function d(p,m){var v=p.alias;v?Array.isArray(v)||(p.alias=v=[v]):p.alias=v=[],v.push(m)}}),G.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,r=t.inside.interpolation,i=r.inside["interpolation-punctuation"],o=r.pattern.source;function s(f,h){if(e.languages[f])return{pattern:RegExp("((?:"+h+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:f}}}}function a(f,h,d){return f={code:f,grammar:h,language:d},e.hooks.run("before-tokenize",f),f.tokens=e.tokenize(f.code,f.grammar),e.hooks.run("after-tokenize",f),f.tokens}function l(f,h,d){var v=e.tokenize(f,{interpolation:{pattern:RegExp(o),lookbehind:!0}}),p=0,m={},v=a(v.map(function(y){if(typeof y=="string")return y;for(var x,k,y=y.content;f.indexOf((k=p++,x="___"+d.toUpperCase()+"_"+k+"___"))!==-1;);return m[x]=y,x}).join(""),h,d),b=Object.keys(m);return p=0,function y(x){for(var k=0;k<x.length;k++){if(p>=b.length)return;var w,S,O,A,P,M,j,E=x[k];typeof E=="string"||typeof E.content=="string"?(w=b[p],(j=(M=typeof E=="string"?E:E.content).indexOf(w))!==-1&&(++p,S=M.substring(0,j),P=m[w],O=void 0,(A={})["interpolation-punctuation"]=i,(A=e.tokenize(P,A)).length===3&&((O=[1,1]).push.apply(O,a(A[1],e.languages.javascript,"javascript")),A.splice.apply(A,O)),O=new e.Token("interpolation",A,r.alias,P),A=M.substring(j+w.length),P=[],S&&P.push(S),P.push(O),A&&(y(M=[A]),P.push.apply(P,M)),typeof E=="string"?(x.splice.apply(x,[k,1].concat(P)),k+=P.length-1):E.content=P)):(j=E.content,Array.isArray(j)?y(j):y([j]))}}(v),new e.Token(d,v,"language-"+d,f)}e.languages.javascript["template-string"]=[s("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),s("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),s("svg",/\bsvg/.source),s("markdown",/\b(?:markdown|md)/.source),s("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),s("sql",/\bsql/.source),t].filter(Boolean);var u={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function c(f){return typeof f=="string"?f:Array.isArray(f)?f.map(c).join(""):c(f.content)}e.hooks.add("after-tokenize",function(f){f.language in u&&function h(d){for(var p=0,m=d.length;p<m;p++){var v,b,y,x=d[p];typeof x!="string"&&(v=x.content,Array.isArray(v)?x.type==="template-string"?(x=v[1],v.length===3&&typeof x!="string"&&x.type==="embedded-code"&&(b=c(x),x=x.alias,x=Array.isArray(x)?x[0]:x,y=e.languages[x])&&(v[1]=l(b,y,x))):h(v):typeof v!="string"&&h([v]))}}(f.tokens)})}(G),function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(G),function(e){var t=e.languages.javascript,n=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,r="(@(?:arg|argument|param|property)\\s+(?:"+n+"\\s+)?)";e.languages.jsdoc=e.languages.extend("javadoclike",{parameter:{pattern:RegExp(r+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(r+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:t,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{string:t.string,number:t.number,boolean:t.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:t,alias:"language-javascript"}}}}),e.languages.javadoclike.addSupport("javascript",e.languages.jsdoc)}(G),function(e){e.languages.flow=e.languages.extend("javascript",{}),e.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),e.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete e.languages.flow.parameter,e.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})}(G),G.languages.n4js=G.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),G.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),G.languages.n4jsd=G.languages.n4js,function(e){function t(s,a){return RegExp(s.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),a)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r<n.length;r++){var o=n[r],i=e.languages.javascript[o],o=(i=e.util.type(i)==="RegExp"?e.languages.javascript[o]={pattern:i}:i).inside||{};(i.inside=o)["maybe-class-name"]=/^[A-Z][\s\S]*/}}(G),function(e){var t=e.util.clone(e.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,i=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function o(l,u){return l=l.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return i}),RegExp(l,u)}i=o(i).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=o(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:o(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:o(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);function s(l){for(var u=[],c=0;c<l.length;c++){var f=l[c],h=!1;typeof f!="string"&&(f.type==="tag"&&f.content[0]&&f.content[0].type==="tag"?f.content[0].content[0].content==="</"?0<u.length&&u[u.length-1].tagName===a(f.content[0].content[1])&&u.pop():f.content[f.content.length-1].content!=="/>"&&u.push({tagName:a(f.content[0].content[1]),openedBraces:0}):0<u.length&&f.type==="punctuation"&&f.content==="{"?u[u.length-1].openedBraces++:0<u.length&&0<u[u.length-1].openedBraces&&f.type==="punctuation"&&f.content==="}"?u[u.length-1].openedBraces--:h=!0),(h||typeof f=="string")&&0<u.length&&u[u.length-1].openedBraces===0&&(h=a(f),c<l.length-1&&(typeof l[c+1]=="string"||l[c+1].type==="plain-text")&&(h+=a(l[c+1]),l.splice(c+1,1)),0<c&&(typeof l[c-1]=="string"||l[c-1].type==="plain-text")&&(h=a(l[c-1])+h,l.splice(c-1,1),c--),l[c]=new e.Token("plain-text",h,null,h)),f.content&&typeof f.content!="string"&&s(f.content)}}var a=function(l){return l?typeof l=="string"?l:typeof l.content=="string"?l.content:l.content.map(a).join(""):""};e.hooks.add("after-tokenize",function(l){l.language!=="jsx"&&l.language!=="tsx"||s(l.tokens)})}(G),function(e){var t=e.util.clone(e.languages.typescript),t=(e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"],e.languages.tsx.tag);t.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+t.pattern.source+")",t.pattern.flags),t.lookbehind=!0}(G),G.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},G.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=G.languages.swift}),function(e){e.languages.kotlin=e.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),e.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin}(G),G.languages.c=G.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),G.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),G.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},G.languages.c.string],char:G.languages.c.char,comment:G.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:G.languages.c}}}}),G.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete G.languages.c.boolean,G.languages.objectivec=G.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete G.languages.objectivec["class-name"],G.languages.objc=G.languages.objectivec,G.languages.reason=G.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),G.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete G.languages.reason.function,function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(G),G.languages.go=G.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),G.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete G.languages.go["class-name"],function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(G),G.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},G.languages.python["string-interpolation"].inside.interpolation.inside.rest=G.languages.python,G.languages.py=G.languages.python,G.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},G.languages.webmanifest=G.languages.json;var QPe={};VPe(QPe,{dracula:()=>YPe,duotoneDark:()=>JPe,duotoneLight:()=>tEe,github:()=>rEe,gruvboxMaterialDark:()=>MEe,gruvboxMaterialLight:()=>NEe,jettwaveDark:()=>OEe,jettwaveLight:()=>AEe,nightOwl:()=>oEe,nightOwlLight:()=>aEe,oceanicNext:()=>uEe,okaidia:()=>fEe,oneDark:()=>EEe,oneLight:()=>_Ee,palenight:()=>dEe,shadesOfPurple:()=>mEe,synthwave84:()=>yEe,ultramin:()=>bEe,vsDark:()=>l8,vsLight:()=>SEe});var XPe={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},YPe=XPe,ZPe={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},JPe=ZPe,eEe={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},tEe=eEe,nEe={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},rEe=nEe,iEe={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},oEe=iEe,sEe={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},aEe=sEe,ar={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},lEe={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:ar.keyword}},{types:["attr-value"],style:{color:ar.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:ar.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:ar.primitive}},{types:["boolean"],style:{color:ar.boolean}},{types:["tag"],style:{color:ar.tag}},{types:["string"],style:{color:ar.string}},{types:["punctuation"],style:{color:ar.string}},{types:["selector","char","builtin","inserted"],style:{color:ar.char}},{types:["function"],style:{color:ar.function}},{types:["operator","entity","url","variable"],style:{color:ar.variable}},{types:["keyword"],style:{color:ar.keyword}},{types:["atrule","class-name"],style:{color:ar.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},uEe=lEe,cEe={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},fEe=cEe,hEe={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},dEe=hEe,pEe={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},mEe=pEe,gEe={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},yEe=gEe,vEe={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},bEe=vEe,xEe={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},l8=xEe,wEe={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},SEe=wEe,kEe={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},OEe=kEe,CEe={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},AEe=CEe,PEe={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},EEe=PEe,TEe={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},_Ee=TEe,jEe={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},MEe=jEe,IEe={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},NEe=IEe,REe=e=>C.useCallback(t=>{var n=t,{className:r,style:i,line:o}=n,s=a8(n,["className","style","line"]);const a=nb(Vi({},s),{className:Se("token-line",r)});return typeof e=="object"&&"plain"in e&&(a.style=e.plain),typeof i=="object"&&(a.style=Vi(Vi({},a.style||{}),i)),a},[e]),DEe=e=>{const t=C.useCallback(({types:n,empty:r})=>{if(e!=null){{if(n.length===1&&n[0]==="plain")return r!=null?{display:"inline-block"}:void 0;if(n.length===1&&r!=null)return e[n[0]]}return Object.assign(r!=null?{display:"inline-block"}:{},...n.map(i=>e[i]))}},[e]);return C.useCallback(n=>{var r=n,{token:i,className:o,style:s}=r,a=a8(r,["token","className","style"]);const l=nb(Vi({},a),{className:Se("token",...i.types,o),children:i.content,style:t(i)});return s!=null&&(l.style=Vi(Vi({},l.style||{}),s)),l},[t])},LEe=/\r\n|\r|\n/,uN=e=>{e.length===0?e.push({types:["plain"],content:`
|
|
376
|
-
`,empty:!0}):e.length===1&&e[0].content===""&&(e[0].content=`
|
|
377
|
-
`,e[0].empty=!0)},cN=(e,t)=>{const n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},$Ee=e=>{const t=[[]],n=[e],r=[0],i=[e.length];let o=0,s=0,a=[];const l=[a];for(;s>-1;){for(;(o=r[s]++)<i[s];){let u,c=t[s];const h=n[s][o];if(typeof h=="string"?(c=s>0?c:["plain"],u=h):(c=cN(c,h.type),h.alias&&(c=cN(c,h.alias)),u=h.content),typeof u!="string"){s++,t.push(c),n.push(u),r.push(0),i.push(u.length);continue}const d=u.split(LEe),p=d.length;a.push({types:c,content:d[0]});for(let m=1;m<p;m++)uN(a),l.push(a=[]),a.push({types:c,content:d[m]})}s--,t.pop(),n.pop(),r.pop(),i.pop()}return uN(a),l},fN=$Ee,BEe=({prism:e,code:t,grammar:n,language:r})=>C.useMemo(()=>{if(n==null)return fN([t]);const i={code:t,grammar:n,language:r,tokens:[]};return e.hooks.run("before-tokenize",i),i.tokens=e.tokenize(t,n),e.hooks.run("after-tokenize",i),fN(i.tokens)},[t,n,r,e]),FEe=(e,t)=>{const{plain:n}=e,r=e.styles.reduce((i,o)=>{const{languages:s,style:a}=o;return s&&!s.includes(t)||o.types.forEach(l=>{const u=Vi(Vi({},i[l]),a);i[l]=u}),i},{});return r.root=n,r.plain=nb(Vi({},n),{backgroundColor:void 0}),r},zEe=FEe,WEe=({children:e,language:t,code:n,theme:r,prism:i})=>{const o=t.toLowerCase(),s=zEe(r,o),a=REe(s),l=DEe(s),u=i.languages[o],c=BEe({prism:i,language:o,code:n,grammar:u});return e({tokens:c,className:`prism-code language-${o}`,style:s!=null?s.root:{},getLineProps:a,getTokenProps:l})},UEe=e=>C.createElement(WEe,nb(Vi({},e),{prism:e.prism||G,theme:e.theme||l8,code:e.code,language:e.language}));/*! Bundled license information:
|
|
378
|
-
|
|
379
|
-
prismjs/prism.js:
|
|
380
|
-
(**
|
|
381
|
-
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
382
|
-
*
|
|
383
|
-
* @license MIT <https://opensource.org/licenses/MIT>
|
|
384
|
-
* @author Lea Verou <https://lea.verou.me>
|
|
385
|
-
* @namespace
|
|
386
|
-
* @public
|
|
387
|
-
*)
|
|
388
|
-
*/const HEe={plain:{color:"var(--color-text)",backgroundColor:"transparent"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"var(--color-text-dim)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"var(--color-text-muted)"}},{types:["namespace"],style:{opacity:.7}},{types:["property","tag","boolean","number","constant","symbol","deleted"],style:{color:"var(--color-info)"}},{types:["selector","attr-name","string","char","builtin","inserted"],style:{color:"var(--color-ok)"}},{types:["operator","entity","url","variable"],style:{color:"var(--color-text)"}},{types:["atrule","attr-value","keyword"],style:{color:"var(--color-warn)"}},{types:["function","class-name"],style:{color:"var(--color-text)"}},{types:["regex","important"],style:{color:"var(--color-fail)"}}]};function u8({source:e}){return g.jsx("div",{className:"prose-docs max-w-none",children:g.jsx(i8,{components:{code({className:t,children:n,...r}){const i=String(n);if(!(!!t?.startsWith("language-")||i.includes(`
|
|
389
|
-
`)))return g.jsx("code",{className:t,...r,children:n});const a=/language-(\w+)/.exec(t??"")?.[1]??"",l=String(n).replace(/\n$/,"");return a?g.jsx(UEe,{code:l,language:a,theme:HEe,children:({tokens:u,getLineProps:c,getTokenProps:f})=>g.jsx("pre",{className:"overflow-x-auto",children:u.map((h,d)=>g.jsx("div",{...c({line:h}),children:h.map((p,m)=>g.jsx("span",{...f({token:p})},m))},d))})}):g.jsx("pre",{className:"overflow-x-auto rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--gray-2)] p-3 text-[13px]",children:g.jsx("code",{className:t,children:n})})}},children:e})})}function bP({tabs:e,defaultIndex:t=0}){const n=C.useId(),[r,i]=C.useState(t),o=C.useCallback(s=>{s.key==="ArrowRight"?(s.preventDefault(),i(a=>(a+1)%e.length)):s.key==="ArrowLeft"?(s.preventDefault(),i(a=>(a-1+e.length)%e.length)):s.key==="Home"?(s.preventDefault(),i(0)):s.key==="End"&&(s.preventDefault(),i(e.length-1))},[e.length]);return g.jsxs("div",{children:[g.jsx("div",{role:"tablist","aria-orientation":"horizontal",className:"flex gap-4 border-b border-[var(--color-border)]",onKeyDown:o,children:e.map((s,a)=>{const l=a===r;return g.jsx("button",{type:"button",role:"tab",id:`${n}-tab-${s.id}`,"aria-selected":l,"aria-controls":`${n}-panel-${s.id}`,tabIndex:l?0:-1,className:l?"relative -mb-px border-b-2 border-[var(--color-text)] px-1 py-2 text-[13px] font-medium text-[var(--color-text)]":"relative -mb-px border-b-2 border-transparent px-1 py-2 text-[13px] text-[var(--color-text-muted)] hover:text-[var(--color-text)]",onClick:()=>i(a),children:s.label},s.id)})}),e.map((s,a)=>g.jsx("div",{id:`${n}-panel-${s.id}`,role:"tabpanel","aria-labelledby":`${n}-tab-${s.id}`,hidden:a!==r,className:"pt-4",children:a===r?s.panel:null},s.id))]})}function VEe({value:e,onChange:t,rows:n=20}){return g.jsx("textarea",{className:"w-full min-h-[320px] rounded-lg border border-[var(--color-border)] bg-[var(--color-bg-elevated)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-dim)] outline-none focus:border-[var(--color-border-strong)] font-mono",value:e,rows:n,onChange:r=>t(r.target.value)})}function qEe(){const{feature:e,id:t}=Pc({from:"/stories/$feature/$id"}),n=_r(),r=yi(),i=r0(),{toast:o}=Qr(),[s,a]=C.useState(null),[l,u]=C.useState(!0),c=wt({queryKey:["story",e,t],queryFn:()=>Me(`/api/stories/${encodeURIComponent(e)}/${encodeURIComponent(t)}`)});C.useEffect(()=>{a(null)},[e,t]);const f=c.data?.intakeContent??"",h=s!==null?s:f,d=Ps({mutationFn:y=>Me("/api/stories/"+encodeURIComponent(e)+"/"+encodeURIComponent(t),{method:"PATCH",body:JSON.stringify({intakeContent:y})}),onSuccess:()=>{r.invalidateQueries({queryKey:["stories"]}),r.invalidateQueries({queryKey:["story",e,t]})}}),p=Ps({mutationFn:()=>Me(`/api/stories/${encodeURIComponent(e)}/${encodeURIComponent(t)}?trash=${l?"1":"0"}`,{method:"DELETE"}),onSuccess:()=>{r.invalidateQueries({queryKey:["stories"]}),o({tone:"success",title:"Story deleted"}),n({to:"/stories"})}});async function m(){await i({title:`Delete ${t}?`,description:`This removes the story folder from .squad/stories/${e}/${t}/.`,tone:"danger",confirmLabel:"Delete story"})&&p.mutate()}if(c.isLoading)return g.jsx(Ce,{title:t,description:"…",children:g.jsx("p",{className:"text-[var(--color-text-muted)]",children:"Loading…"})});if(c.isError)return g.jsx(Ce,{title:t,description:"…",children:g.jsx(Ae,{tone:"danger",children:c.error.message})});if(!c.data)return null;const v=c.data,b=v.titleHint??t;return g.jsx(Ce,{title:b,description:g.jsxs("span",{children:[g.jsx("span",{className:"font-mono text-[13px] text-[var(--color-text-muted)]",children:v.id}),v.planFile?g.jsxs("span",{className:"text-[var(--color-text-muted)]",children:[" ","· plan ",g.jsx("span",{className:"font-mono",children:v.planFile})]}):null]}),actions:g.jsx(fe,{type:"button",variant:"danger",leftIcon:g.jsx(zh,{size:14}),onClick:()=>void m(),children:"Delete story"}),children:g.jsxs("div",{className:"grid gap-6 lg:grid-cols-[minmax(0,1fr)_280px]",children:[g.jsxs("div",{children:[g.jsx("div",{className:"mb-4 flex items-center gap-2 text-sm",children:g.jsx(vt,{to:"/stories",className:"text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"← Stories"})}),g.jsx(bP,{defaultIndex:0,tabs:[{id:"preview",label:"Preview",panel:g.jsx(u8,{source:v.intakeContent})},{id:"edit",label:"Edit",panel:g.jsxs("div",{className:"space-y-3",children:[g.jsx(VEe,{value:h,onChange:y=>a(y)}),g.jsx(fe,{type:"button",onClick:()=>{d.mutate(h)},disabled:d.isPending,children:"Save"})]})}]}),g.jsx("div",{className:"mt-6 border-t border-[var(--color-border)] pt-4",children:g.jsxs("label",{className:"mb-3 flex items-center gap-2 text-sm text-[var(--color-text-muted)]",children:[g.jsx("input",{type:"checkbox",checked:l,onChange:y=>u(y.target.checked),className:"rounded"}),"Move to trash (instead of permanent delete)"]})})]}),g.jsxs(He,{className:"h-fit",variant:"default",children:[g.jsx("h3",{className:"mb-3 text-sm font-semibold text-[var(--color-text-dim)]",children:"Metadata"}),g.jsxs("dl",{className:"space-2 text-sm",children:[g.jsxs("div",{children:[g.jsx("dt",{className:"text-[var(--color-text-dim)]",children:"Feature"}),g.jsx("dd",{className:"font-mono",children:v.feature})]}),g.jsxs("div",{children:[g.jsx("dt",{className:"text-[var(--color-text-dim)]",children:"Id"}),g.jsx("dd",{className:"font-mono break-all",children:v.id})]}),g.jsxs("div",{children:[g.jsx("dt",{className:"text-[var(--color-text-dim)]",children:"intake.md"}),g.jsx("dd",{className:"font-mono text-xs break-all text-[var(--color-text-muted)]",children:v.intakePath})]}),g.jsxs("div",{children:[g.jsx("dt",{className:"text-[var(--color-text-dim)]",children:"Plan"}),g.jsx("dd",{children:v.planFile?g.jsx(vt,{to:"/plans/$feature/$planFile",params:{feature:v.feature,planFile:v.planFile},className:"text-[var(--color-accent)] underline",children:v.planFile}):"—"})]})]})]})]})})}const KEe={sm:"h-7 w-7",md:"h-8 w-8"},GEe={ghost:"text-[var(--color-text-muted)] hover:text-[var(--color-text)] hover:bg-[var(--gray-3)]",secondary:"border border-[var(--color-border)] bg-[var(--gray-3)] text-[var(--color-text)] hover:bg-[var(--gray-4)]"},Nk=C.forwardRef(function({icon:t,label:n,size:r="md",variant:i="ghost",className:o="",...s},a){return g.jsx(Wg,{label:n,children:g.jsx("button",{ref:a,type:"button","aria-label":n,className:`inline-flex items-center justify-center rounded-[var(--radius-md)] transition-colors ${KEe[r]} ${GEe[i]} ${o}`,...s,children:t})})});function QEe(e){const t=new Map;for(const n of e){const r=t.get(n.feature)??[];r.push(n),t.set(n.feature,r)}return[...t.entries()].sort(([n],[r])=>n.localeCompare(r)).map(([n,r])=>({feature:n,plans:r.sort((i,o)=>i.planFile.localeCompare(o.planFile))}))}function XEe(){const e=yi(),t=_r(),n=r0(),{toast:r}=Qr(),[i,o]=C.useState(null),s=wt({queryKey:["plans"],queryFn:()=>Me("/api/plans")}),a=Ps({mutationFn:({feature:f,planFile:h})=>Me(`/api/plans/${encodeURIComponent(f)}/${encodeURIComponent(h)}?trash=1`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["plans"]})}});async function l(f){await n({title:`Delete ${f.planFile}?`,description:"The plan file will be moved to trash.",tone:"danger",confirmLabel:"Delete"})&&(await a.mutateAsync({feature:f.feature,planFile:f.planFile}),r({tone:"success",title:"Plan deleted"}))}if(s.isLoading)return g.jsx(Ce,{title:"Plans",description:"Generated plan files. Compare versions and clean up old drafts.",children:g.jsx("div",{className:"space-y-2",children:Array.from({length:6}).map((f,h)=>g.jsx(Tn,{className:"h-9"},h))})});if(s.isError)return g.jsx(Ce,{title:"Plans",description:"Generated plan files. Compare versions and clean up old drafts.",children:g.jsx(Ae,{tone:"danger",children:s.error.message})});const u=QEe(s.data??[]),c=s.data??[];return g.jsxs(Ce,{title:"Plans",description:"Generated plan files. Compare versions and clean up old drafts.",children:[u.length===0?g.jsx(Ae,{tone:"info",children:"No plan files found."}):g.jsx("div",{className:"space-y-8",children:u.map(({feature:f,plans:h})=>g.jsxs("div",{children:[g.jsx("div",{className:"mb-2 px-3 text-[11px] font-semibold uppercase tracking-wider text-[var(--color-text-dim)]",children:f}),g.jsx("ul",{className:"overflow-hidden rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)]",children:h.map((d,p)=>{const m=d.planFile.endsWith(".partial.md"),v=d.metadata?.generatedBy??d.metadata?.model??"—",b=c.some(y=>y.feature===d.feature&&y.planFile!==d.planFile);return g.jsxs("li",{className:"flex flex-wrap items-center gap-3 border-[var(--color-border)] px-3 py-[var(--space-row-y)] "+(p>0?"border-t":""),children:[g.jsx(vt,{to:"/plans/$feature/$planFile",params:{feature:d.feature,planFile:d.planFile},className:"min-w-0 flex-1 break-all font-mono text-[13px] text-[var(--color-text)] hover:underline",children:d.planFile}),g.jsxs("div",{className:"ml-auto flex shrink-0 flex-wrap items-center justify-end gap-2",children:[m?g.jsx(Ee,{tone:"warning",children:"partial"}):null,g.jsx("span",{className:"chip max-w-[200px] truncate",title:v,children:v}),b?g.jsx(Nk,{icon:g.jsx(wF,{size:14}),label:"Compare with…",onClick:()=>o(d)}):null,g.jsx(Nk,{icon:g.jsx(zh,{size:14}),label:"Delete plan",onClick:()=>void l(d)})]})]},d.planFile)})})]},f))}),g.jsx(Tc,{open:i!==null,onClose:()=>o(null),title:"Compare with",footer:g.jsx(fe,{type:"button",variant:"secondary",onClick:()=>o(null),children:"Close"}),children:i?(()=>{const f=c.filter(h=>h.feature===i.feature&&h.planFile!==i.planFile);return f.length===0?g.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"No other plans in this feature to compare."}):g.jsx("ul",{className:"space-y-1",children:f.map(h=>g.jsx("li",{children:g.jsx("button",{type:"button",className:"w-full text-left font-mono text-sm text-[var(--color-accent)] hover:underline",onClick:()=>{const d=i.planFile,p=h.planFile,m=i.feature;o(null),t({to:"/plans/$feature/diff",params:{feature:m},search:{a:d,b:p}})},children:h.planFile})},h.planFile))})})():null})]})}function YEe(){const{feature:e,planFile:t}=Pc({from:"/plans/$feature/$planFile"}),n=_r(),r=yi(),i=r0(),{toast:o}=Qr(),[s,a]=C.useState(!1),[l,u]=C.useState(!0),[c,f]=C.useState(null),h=wt({queryKey:["plan",e,t],queryFn:()=>Me(`/api/plans/${encodeURIComponent(e)}/${encodeURIComponent(t)}`)}),d=wt({queryKey:["plans"],queryFn:()=>Me("/api/plans")}),p=C.useMemo(()=>(d.data??[]).filter(w=>w.feature===e&&w.planFile!==t),[d.data,e,t]),m=Ps({mutationFn:()=>Me(`/api/plans/${encodeURIComponent(e)}/${encodeURIComponent(t)}?trash=${l?"1":"0"}`,{method:"DELETE"}),onSuccess:()=>{r.invalidateQueries({queryKey:["plans"]}),o({tone:"success",title:"Plan deleted"}),n({to:"/plans"})}});async function v(){await i({title:`Delete ${t}?`,description:`Remove ${t} ${l?"to the trash folder":"permanently"}.`,tone:"danger",confirmLabel:"Delete plan"})&&m.mutate()}if(h.isLoading)return g.jsx(Ce,{title:t,description:"…",children:g.jsx("p",{className:"text-[var(--color-text-muted)]",children:"Loading…"})});if(h.isError)return g.jsx(Ce,{title:t,description:"…",children:g.jsx(Ae,{tone:"danger",children:h.error.message})});if(!h.data)return null;const b=h.data,y=b.metadata?.generatedBy?`${b.metadata.provider??""}/${b.metadata.model??b.metadata.generatedBy}`.replace(/^\//,""):"—",x=()=>{const w=b.absPath;window.location.href=`vscode://file${w.startsWith("/")?"":"/"}${w}`.replace(/\s/g,"%20")},k=async()=>{try{await navigator.clipboard.writeText(b.absPath),f("Path copied"),setTimeout(()=>f(null),2e3)}catch{f("Copy failed (browser blocked)")}};return g.jsxs(Ce,{title:g.jsx("span",{className:"break-all font-mono",children:b.planFile}),description:`Generated by ${y}`,actions:g.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g.jsx(fe,{type:"button",variant:"secondary",onClick:x,children:"Open in editor"}),g.jsx(fe,{type:"button",variant:"secondary",onClick:k,children:"Copy path"}),c?g.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:c}):null,p.length>0?g.jsx(fe,{type:"button",variant:"secondary",leftIcon:g.jsx(wF,{size:14}),onClick:()=>a(!0),children:"Compare with…"}):null,g.jsx(fe,{type:"button",variant:"danger",leftIcon:g.jsx(zh,{size:14}),onClick:()=>void v(),children:"Delete plan"})]}),children:[g.jsx("div",{className:"mb-4 text-sm",children:g.jsx(vt,{to:"/plans",className:"text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"← Plans"})}),g.jsxs("label",{className:"mb-4 flex items-center gap-2 text-sm text-[var(--color-text-muted)]",children:[g.jsx("input",{type:"checkbox",checked:l,onChange:w=>u(w.target.checked),className:"rounded"}),"Move to trash"]}),g.jsxs("details",{className:"mb-6 rounded-lg border border-[var(--color-border)] bg-[var(--color-bg-elevated)] p-3 text-sm",children:[g.jsx("summary",{className:"cursor-pointer text-[var(--color-text-dim)]",children:"Metadata"}),g.jsx("pre",{className:"mt-2 overflow-x-auto text-xs text-[var(--color-text-muted)]",children:JSON.stringify(b.metadata,null,2)})]}),g.jsx(u8,{source:b.content}),g.jsx(Tc,{open:s,onClose:()=>a(!1),title:"Compare with",footer:g.jsx(fe,{type:"button",variant:"secondary",onClick:()=>a(!1),children:"Close"}),children:g.jsx("ul",{className:"space-y-1",children:p.map(w=>g.jsx("li",{children:g.jsx("button",{type:"button",className:"w-full text-left font-mono text-sm text-[var(--color-accent)] hover:underline",onClick:()=>{a(!1),n({to:"/plans/$feature/diff",params:{feature:e},search:{a:t,b:w.planFile}})},children:w.planFile})},w.planFile))})})]})}const ZEe=5;function JEe(e){return e.value.replace(/\n$/,"").split(`
|
|
390
|
-
`)}const sm={color:"var(--color-text)"},eTe={background:"var(--color-fail-bg)",color:"var(--color-fail)",borderLeft:"3px solid var(--color-fail)"},tTe={background:"var(--color-ok-bg)",color:"var(--color-ok)",borderLeft:"3px solid var(--color-ok)"};function nTe(){const{feature:e}=Pc({from:"/plans/$feature/diff"}),{a:t,b:n}=Ec({from:"/plans/$feature/diff"}),r=_r(),[i,o]=C.useState(()=>new Set),s=wt({queryKey:["planDiff",e,t,n],enabled:!!(t&&n),queryFn:()=>Me(`/api/plans/diff?feature=${encodeURIComponent(e)}&a=${encodeURIComponent(t)}&b=${encodeURIComponent(n)}`)});if(!t||!n)return g.jsx(Ce,{title:"Plan diff",description:"Compare two plan files.",children:g.jsx(Ae,{tone:"warning",children:"Select two plan files to compare (missing a or b)."})});if(s.isLoading)return g.jsx(Ce,{title:"Plan diff",description:`${t} ↔ ${n}`,children:g.jsx("p",{className:"text-[var(--color-text-muted)]",children:"Computing diff…"})});if(s.isError)return g.jsx(Ce,{title:"Plan diff",description:`${t} ↔ ${n}`,children:g.jsx(Ae,{tone:"danger",children:s.error.message})});if(!s.data)return null;const a=()=>{r({to:"/plans/$feature/diff",params:{feature:e},search:{a:n,b:t}})};return g.jsxs(Ce,{title:"Plan diff",description:`${t} ↔ ${n}`,children:[g.jsx("div",{className:"mb-4 text-sm",children:g.jsx(vt,{to:"/plans",className:"text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"← Plans"})}),g.jsx("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-2",children:g.jsx(fe,{type:"button",variant:"secondary",onClick:a,children:"Swap A ↔ B"})}),g.jsxs("div",{className:"mb-2 grid grid-cols-2 gap-2 text-xs text-[var(--color-text-dim)]",children:[g.jsxs("div",{className:"truncate pr-1 font-mono",children:["A: ",t]}),g.jsxs("div",{className:"truncate pl-1 font-mono",children:["B: ",n]})]}),g.jsx(He,{variant:"inset",children:g.jsx("div",{className:"space-y-2",children:s.data.changes.map((l,u)=>{if(!l.added&&!l.removed){const d=JEe(l),p=d.length>ZEe&&!i.has(u),m=p?`${d.slice(0,2).join(`
|
|
391
|
-
`)}
|
|
392
|
-
… ${d.length-4} unchanged lines hidden …
|
|
393
|
-
${d.slice(-2).join(`
|
|
394
|
-
`)}`:d.join(`
|
|
395
|
-
`);return g.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[g.jsxs("div",{className:"min-w-0 rounded border border-[var(--color-border)] p-2 font-mono text-xs whitespace-pre-wrap break-words",style:sm,children:[m,p&&g.jsx("div",{className:"mt-1",children:g.jsxs(fe,{type:"button",variant:"ghost",onClick:()=>o(v=>new Set(v).add(u)),children:["Expand ",d.length-4," lines"]})})]}),g.jsxs("div",{className:"min-w-0 rounded border border-[var(--color-border)] p-2 font-mono text-xs whitespace-pre-wrap break-words",style:sm,children:[m,p&&g.jsx("div",{className:"mt-1",children:g.jsxs(fe,{type:"button",variant:"ghost",onClick:()=>o(v=>new Set(v).add(u)),children:["Expand ",d.length-4," lines"]})})]})]},u)}const f=l.added?"":l.value.endsWith(`
|
|
396
|
-
`)?l.value.slice(0,-1):l.value,h=l.removed?"":l.value.endsWith(`
|
|
397
|
-
`)?l.value.slice(0,-1):l.value;return g.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[g.jsx("div",{className:"min-w-0 rounded border border-[var(--color-border)] p-2 font-mono text-xs whitespace-pre-wrap break-words",style:l.removed?eTe:sm,children:f}),g.jsx("div",{className:"min-w-0 rounded border border-[var(--color-border)] p-2 font-mono text-xs whitespace-pre-wrap break-words",style:l.added?tTe:sm,children:h})]},u)})})})]})}const Of=52;function c8({rows:e,jumpStage:t,replayed:n}){const r=C.useRef(null),[i,o]=C.useState(!1),s=e.length>100,a=s&&i,[l,u]=C.useState(0),c=420;C.useEffect(()=>{if(n||!t||!r.current)return;const m=`[data-stage-marker="${t}"],[data-feed-stage="${t}"]`;r.current.querySelector(m)?.scrollIntoView({behavior:"smooth",block:"start"})},[t,e,n]);const f=C.useMemo(()=>{if(!a)return{top:0,items:e,bot:0};const m=e.length*Of,v=Math.ceil(c/Of)+6,b=Math.max(0,Math.floor(l/Of)-3),y=Math.min(e.length,b+v);return{top:b*Of,items:e.slice(b,y),bot:m-y*Of}},[a,e,l]),h=a?f.items:e,d=e.some(m=>m.type==="tool");let p;return e.length===0?p=g.jsx("p",{className:"px-3 py-6 text-center text-sm text-[var(--color-text-muted)]",children:"Planner did not emit timeline events yet."}):!a&&!d&&e.length>0?p=g.jsxs(g.Fragment,{children:[g.jsx("p",{className:"mb-4 px-2 text-[12px] text-[var(--color-text-muted)]",children:"Planner did not need any file reads."}),h.map(m=>g.jsx(hN,{row:m,replayed:n},m.id))]}):p=h.map(m=>g.jsx(hN,{row:m,replayed:n},m.id)),g.jsxs("div",{"data-testid":"activity-feed",className:"flex min-h-[280px] flex-col rounded-xl border border-[var(--color-border)] bg-[var(--gray-2)]",children:[g.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--color-border)] px-3 py-2",children:[g.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--color-text-muted)]",children:"Activity"}),s?g.jsx("button",{type:"button","data-testid":"activity-toggle-virt",className:"rounded-md border border-[var(--color-border)] px-2 py-1 text-[10px] text-[var(--color-text-muted)] hover:bg-[var(--gray-3)]",onClick:()=>{o(m=>!m),u(0)},children:i?"Show recent · compact":"Show all · virtual scroll"}):null]}),g.jsx("div",{ref:r,className:"squad-scrollbar flex-1 overflow-y-auto px-2 py-2",style:{maxHeight:c},onScroll:m=>{a&&u(m.target.scrollTop)},children:g.jsx("div",{style:{paddingTop:f.top,paddingBottom:f.bot},children:p})})]})}function hN({row:e,replayed:t}){if(e.type==="stage_marker")return g.jsxs("div",{"data-stage-marker":e.stage,"data-testid":`feed-stage-${e.stage}`,className:"my-3 border-t border-dashed border-[var(--gray-7)] pt-2 text-[10px] font-semibold uppercase tracking-widest text-[var(--color-text-muted)] squad-row-enter squad-row-enter--reduce",children:["▶ ",e.stage]});const n=e.type==="scout_decision"?"scout":e.stage,r=i=>g.jsx("div",{"data-feed-stage":n,children:i},e.id);return e.type==="scout_decision"?r(g.jsxs("div",{className:"squad-row-enter squad-row-enter--reduce mb-2 flex gap-3 rounded-lg border border-[var(--color-border)] bg-[var(--gray-3)] p-2 text-[13px]",children:[g.jsx(n0,{size:18,className:"mt-0.5 shrink-0 text-[var(--color-accent)]"}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("div",{className:"font-medium text-[var(--color-text)]",children:"Scout selection"}),g.jsx("pre",{className:"mt-1 max-h-36 overflow-auto whitespace-pre-wrap font-mono text-[11px] text-[var(--color-text-muted)]",children:e.reasoning||e.selected.join(`
|
|
398
|
-
`)})]})]})):e.type==="validation_issue"?r(g.jsxs("div",{className:"squad-row-enter squad-row-enter--reduce mb-2 flex gap-3 rounded-lg border border-[var(--color-warn-border)] bg-[var(--color-warn-bg)] p-2",children:[g.jsx(t0,{size:18,className:"mt-0.5 shrink-0 text-[var(--color-warn)]"}),g.jsxs("div",{className:"min-w-0 text-[13px]",children:[g.jsx("div",{className:"font-medium text-[var(--color-text)]",children:e.issue.issueKind}),e.issue.path?g.jsx("div",{className:"font-mono text-[11px] text-[var(--color-text-muted)]",children:e.issue.path}):null,g.jsx("p",{className:"text-[var(--color-text-muted)]",children:e.issue.detail})]})]})):e.type==="tool"?r(g.jsx(rTe,{row:e})):e.type==="thinking"?r(g.jsx(iTe,{row:e,replayed:t})):null}function rTe({row:e}){const t=e.rowState==="running",n=e.rowState==="error",i=`${e.path??e.name}${e.bytesLoaded!=null?` · ${Math.round(e.bytesLoaded/1024)} KB`:""}`,o=e.durationMs!=null?`${Math.round(e.durationMs/1e3)}s`:t?"…":"—";return g.jsxs("div",{className:`squad-row-enter squad-row-enter--reduce mb-2 flex gap-3 rounded-lg border p-2 ${n?"border-[var(--color-fail-border)] bg-[var(--color-fail-bg)]":t?"squad-row-inflight border-[var(--color-inflight)]/35 bg-[var(--gray-4)]":"border-[var(--color-border)] bg-[var(--gray-3)] opacity-[0.92]"}`,children:[t?g.jsx(kF,{className:"mt-1 h-[18px] w-[18px] shrink-0 animate-spin text-[var(--color-inflight)]"}):n?g.jsx(t0,{size:18,className:"mt-1 shrink-0 text-[var(--color-fail)]"}):g.jsx(JQ,{size:18,className:"mt-1 shrink-0 text-[var(--color-ok)]"}),g.jsxs("div",{className:"min-w-0 flex-1 text-[13px]",children:[g.jsxs("div",{className:"flex flex-wrap gap-2 font-medium text-[var(--color-text)]",children:[g.jsx(TF,{size:14,className:"text-[var(--color-text-muted)]"}),e.name," ",g.jsxs("span",{className:"tabular text-[var(--color-text-muted)]",children:["turn ",e.turn]})]}),g.jsx("div",{className:`truncate font-mono text-[11px] ${t?"text-[var(--color-inflight)]":"text-[var(--color-text-muted)]"}`,children:i}),n&&e.errorSnippet?g.jsx("p",{className:"mt-1 border-l-2 border-[var(--color-fail-border)] pl-2 text-[12px] text-[var(--color-fail)]",children:e.errorSnippet}):null]}),g.jsx("span",{className:"tabular text-[11px] text-[var(--color-text-muted)]",children:o})]})}function iTe({row:e,replayed:t}){const[n,r]=C.useState(!1),i=`thought ${e.durationMs!=null?`${Math.round(e.durationMs/1e3)}s`:"…"}, ${e.chars??e.text.length} chars — expand`,o=n,s=t&&e.summaryOnly;return g.jsxs("div",{"data-testid":"thinking-row",className:"squad-row-enter squad-row-enter--reduce mb-2 rounded-lg border border-[var(--color-thinking)]/50 bg-[var(--gray-3)] p-2",children:[g.jsxs("button",{type:"button",className:"flex w-full items-start gap-2 text-left text-[13px]","aria-expanded":n,onClick:()=>r(!n),children:[g.jsx(eX,{size:16,className:"mt-0.5 shrink-0",style:{color:"var(--color-thinking)"}}),g.jsxs("span",{className:"flex flex-1 flex-col gap-1 text-[var(--color-thinking)]",children:["Thinking",g.jsx("span",{className:"inline-flex w-fit rounded border border-[var(--color-thinking)]/40 px-2 py-0.5 font-mono text-[10px] text-[var(--color-text-muted)]",children:s?`${i} · summary only`:i})]})]}),o?s?g.jsx("p",{className:"mt-2 px-2 text-[12px] italic text-[var(--color-text-muted)]",children:"Thinking text not persisted (block summary only)."}):g.jsx("pre",{className:"mt-2 max-h-52 overflow-auto rounded bg-[var(--gray-2)] p-2 font-mono text-[11px] text-[var(--color-text-muted)]",children:e.text.length?e.text:e.summaryOnly?"(summary only replay)":"(streaming…)"}):null]})}function oTe(e){return e>=90?"var(--color-fail)":e>=70?"var(--color-pressure)":"var(--gray-10)"}function f8({budget:e,startedAtMs:t,replayWallSec:n}){const[,r]=C.useState(0);C.useEffect(()=>{if(n!=null||t==null)return;const u=window.setInterval(()=>r(c=>c+1),900);return()=>window.clearInterval(u)},[t,n]);const i=e.caps;if(!i)return g.jsx("p",{"data-testid":"budget-meters-placeholder",className:"mb-4 text-xs text-[var(--color-text-muted)]",children:"Budget caps arrive with runtime telemetry…"});const o=n!=null?Math.max(0,n):t!=null?Math.max(0,Math.floor((Date.now()-t)/1e3)):0,s=i.maxFileReads>0?e.fileReadsCompleted/i.maxFileReads*100:0,a=i.maxContextBytes>0?e.contextBytesApprox/i.maxContextBytes*100:0,l=i.maxDurationSeconds>0?o/i.maxDurationSeconds*100:0;return g.jsxs("div",{"data-testid":"budget-meters",className:"mb-4 grid gap-2 rounded-lg border border-[var(--color-border)] bg-[var(--gray-2)] p-3 text-xs",children:[g.jsx(Jx,{label:"File reads",barPct:Math.min(100,s),title:`${e.fileReadsCompleted} / ${i.maxFileReads}`}),g.jsx(Jx,{label:"Context (approx)",barPct:Math.min(100,a),title:`${Math.round(e.contextBytesApprox/1024)} KB / ${Math.round(i.maxContextBytes/1024)} KB cap`}),g.jsx(Jx,{label:"Wall clock",barPct:Math.min(100,l),title:`${o}s / ${i.maxDurationSeconds}s`})]})}function Jx({label:e,barPct:t,title:n}){return g.jsxs("div",{title:n,children:[g.jsxs("div",{className:"mb-0.5 flex justify-between text-[var(--color-text-muted)]",children:[g.jsx("span",{children:e}),g.jsxs("span",{className:"tabular",children:[Math.round(t),"%"]})]}),g.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-[var(--gray-5)]",children:g.jsx("div",{className:"h-full rounded-full transition-[width] duration-300",style:{width:`${t}%`,background:oTe(t)}})})]})}function dN({values:e,accent:t}){if(e.length===0)return g.jsx("svg",{width:260,height:64});const i=Math.min(...e),s=Math.max(...e)-i||1,l=e.map((u,c)=>{const f=e.length<=1?130:c/(e.length-1)*252+4,h=(u-i)/s*52+6;return`${f},${64-h}`}).join(" ");return g.jsx("svg",{width:260,height:64,viewBox:"0 0 260 64",className:"max-w-full","aria-hidden":!0,children:g.jsx("polyline",{fill:"none",stroke:t,strokeWidth:"2",points:l})})}function sTe({markdown:e,replayed:t}){const n=C.useRef(null),[r,i]=C.useState(!t);return C.useEffect(()=>{if(t)return;const o=n.current;if(!o)return;const s=()=>{i(o.scrollHeight-o.scrollTop-o.clientHeight<40)};return o.addEventListener("scroll",s,{passive:!0}),()=>o.removeEventListener("scroll",s)},[t]),C.useEffect(()=>{if(t)return;const o=requestAnimationFrame(()=>{const s=n.current;!s||!r||(s.scrollTop=s.scrollHeight)});return()=>cancelAnimationFrame(o)},[e,r,t]),g.jsxs("div",{className:"relative flex min-h-[240px] flex-col overflow-hidden rounded border border-[var(--color-border)] bg-[var(--gray-3)] md:min-h-[280px]",children:[!t&&!r?g.jsx("button",{type:"button",className:"absolute bottom-3 right-3 z-[1] rounded-full bg-[var(--gray-12)] px-3 py-1 text-[11px] font-medium text-[var(--gray-1)] shadow-md",onClick:()=>{i(!0);const o=n.current;o&&(o.scrollTop=o.scrollHeight)},children:"↓ jump to live"}):null,g.jsx("div",{ref:n,className:"squad-scrollbar max-h-[460px] min-h-[200px] flex-1 overflow-y-auto px-4 py-3 prose-docs",children:e?g.jsx(i8,{children:e}):g.jsx("span",{className:"text-[var(--color-text-muted)]",children:"Waiting…"})})]})}function aTe({validation:e}){if(e.length===0)return g.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"No validation issues flagged."});const t={warning:"bg-[var(--color-warn)]",error:"bg-[var(--color-fail)]"};return g.jsx("ul",{className:"max-h-[420px] space-y-2 overflow-y-auto",children:e.map(n=>g.jsxs("li",{className:"flex gap-3 rounded-lg border border-[var(--color-border)] bg-[var(--gray-3)] p-2 text-[13px]",children:[g.jsx("span",{className:`mt-2 h-2 w-2 shrink-0 rounded-full ${t[n.severity]}`}),g.jsxs("div",{className:"min-w-0",children:[g.jsx("span",{className:"chip mr-2 text-[10px]",children:n.issueKind}),n.path?g.jsx("div",{className:"font-mono text-[11px] text-[var(--color-text-muted)]",children:n.path}):null,g.jsx("p",{className:"text-[var(--color-text-muted)]",children:n.detail})]})]},n.id))})}function lTe({state:e}){const t=e.tokens.perTurn.map(i=>i.sum),n=e.cacheHitPctPerTurn,r=e.runtime?[["provider",e.runtime.provider],["model",e.runtime.model],["runtimeKind",e.runtime.runtimeKind],["cache enabled",e.runtime.cacheEnabled?"yes":"no"],["scout",e.runtime.scoutEnabled?"on":"off"],["validation",e.runtime.validationEnabled?"on":"off"]]:[];return g.jsxs("div",{className:"grid max-h-[480px] gap-4 overflow-y-auto",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"mb-1 text-[12px] font-semibold uppercase text-[var(--color-text-muted)]",children:"Tokens / turn"}),g.jsx(dN,{values:t,accent:"var(--color-inflight)"})]}),g.jsxs("div",{children:[g.jsx("h3",{className:"mb-1 text-[12px] font-semibold uppercase text-[var(--color-text-muted)]",children:"Cache hit % per update"}),g.jsx(dN,{values:n,accent:"var(--color-ok)"})]}),g.jsx("div",{className:"overflow-x-auto rounded border border-[var(--color-border)]",children:g.jsxs("table",{className:"w-full border-collapse text-left text-[13px]",children:[g.jsx("thead",{children:g.jsxs("tr",{className:"bg-[var(--gray-2)] text-[var(--color-text-muted)]",children:[g.jsx("th",{className:"p-2",children:"Key"}),g.jsx("th",{className:"p-2",children:"Value"})]})}),g.jsx("tbody",{children:r.map(([i,o])=>g.jsxs("tr",{className:"border-t border-[var(--color-border)]",children:[g.jsx("td",{className:"p-2 font-mono text-[11px]",children:i}),g.jsx("td",{className:"p-2 font-mono text-[11px]",children:String(o)})]},i))})]})})]})}function uTe({tabs:e,initialTabId:t}){const n=C.useId(),r=t?e.findIndex(a=>a.id===t):0,i=r>=0?r:0,[o,s]=C.useState(i);return g.jsxs("div",{"data-testid":"live-tabs-root",children:[g.jsx("div",{role:"tablist","aria-orientation":"horizontal",className:"flex gap-4 border-b border-[var(--color-border)]",children:e.map((a,l)=>g.jsx("button",{type:"button",role:"tab",id:`${n}-tab-${a.id}`,"aria-selected":l===o,"aria-controls":`${n}-panel-${a.id}`,tabIndex:l===o?0:-1,className:l===o?"relative -mb-px border-b-2 border-[var(--color-text)] px-1 py-2 text-[13px] font-medium text-[var(--color-text)]":"relative -mb-px border-b-2 border-transparent px-1 py-2 text-[13px] text-[var(--color-text-muted)] hover:text-[var(--color-text)]",onClick:()=>s(l),children:a.label},a.id))}),e.map((a,l)=>g.jsx("div",{id:`${n}-panel-${a.id}`,role:"tabpanel","aria-labelledby":`${n}-tab-${a.id}`,hidden:l!==o,className:"pt-4",children:a.panel},a.id))]})}function h8({state:e,replayed:t,initialTab:n,hideIssuesTab:r}){const i=e.validation.length,o=[{id:"plan",label:"Plan",panel:g.jsx(sTe,{markdown:e.assistantMd,replayed:t})},{id:"issues",label:g.jsxs("span",{className:"inline-flex items-center gap-2",children:["Issues",i?g.jsx("span",{"aria-label":`Issues count ${i}`,children:i}):null]}),panel:g.jsx(aTe,{validation:e.validation})},{id:"telemetry",label:"Telemetry",panel:g.jsx(lTe,{state:e})}],s=r?o.filter(l=>l.id!=="issues"):[...o],a=r&&n==="issues"?"plan":n??"plan";return g.jsx("div",{className:"rounded-xl border border-[var(--color-border)] bg-[var(--gray-2)] p-3",children:g.jsx(uTe,{tabs:s,initialTabId:a})})}function cTe(e){return e==="idle"?{label:"idle",tone:"default"}:e==="starting"||e==="streaming"||e==="cancelling"?{label:"running",tone:"info"}:e==="done"?{label:"succeeded",tone:"success"}:e==="cancelled"?{label:"cancelled",tone:"warning"}:{label:"failed",tone:"danger"}}function fTe(e){return e==="cancelling"?g.jsx(kF,{className:"h-4 w-4 animate-spin text-[var(--color-info)]"}):null}function d8({state:e,elapsedSec:t,onCancel:n=()=>{},cancelDisabled:r,frozen:i}){const o=cTe(e.phase),s=e.tokens.sum,a=Math.max(8e3,s*1.15),l=Math.max(0,s-a),u=a>0?Math.min(100,Math.round(e.tokens.input/a*100)):0,c=a>0?Math.min(100,Math.round(e.tokens.output/a*100)):0,f=!i&&(e.phase==="streaming"||e.phase==="starting"||e.phase==="cancelling"),h=e.multiTab.count>0,d=e.cacheHitPct!=null?e.cacheHitPct/100:0;return g.jsx("div",{"data-testid":"generate-metrics-bar",className:"sticky z-[var(--z-sticky)] -mx-[1px] mb-4 border-y border-[var(--color-border)] bg-[var(--color-bg-elevated)]/95 px-3 py-2 backdrop-blur sm:px-4",children:g.jsxs("div",{className:"mx-auto flex max-w-[1400px] flex-wrap items-center gap-3",children:[g.jsxs("div",{className:"inline-flex items-center gap-2",children:[i?g.jsx(Ee,{tone:"info",title:"Hydrated from saved events",children:"replay"}):null,o.label==="running"?fTe(e.phase)??g.jsx(Yd,{size:"sm","aria-hidden":!0}):null,g.jsx(Ee,{tone:o.tone,dot:!i&&o.label==="running",children:o.label==="running"&&e.phase==="cancelling"?"cancelling":o.label})]}),g.jsxs("span",{className:"text-xs tabular text-[var(--color-text-muted)]",children:[t,"s elapsed"]}),g.jsxs("span",{className:"hidden text-xs text-[var(--color-text-muted)] sm:inline",children:["· turn ",e.turn]}),g.jsx("div",{className:"flex shrink-0 items-center gap-1 text-[11px] text-[var(--color-text-muted)]",children:g.jsx("span",{className:"max-w-[180px] truncate font-mono sm:max-w-[260px]",title:e.runtime?.model,children:e.runtime?.model??"model…"})}),g.jsxs("div",{className:"flex min-w-[180px] flex-1 basis-[260px] items-center gap-3",children:[g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsxs("div",{className:"mb-0.5 flex justify-between text-[10px] uppercase tracking-wide text-[var(--color-text-muted)]",children:[g.jsx("span",{children:"input"}),g.jsx("span",{className:"tabular text-[var(--color-inflight)]",children:e.tokens.input})]}),g.jsx("div",{className:"squad-inflight squad-inflight--reduce h-1.5 overflow-hidden rounded-full bg-[var(--gray-5)]",children:g.jsx("div",{className:"h-full rounded-full bg-[var(--color-inflight)] transition-[width] duration-300",style:{width:`${u}%`,opacity:.92}})})]}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsxs("div",{className:"mb-0.5 flex justify-between text-[10px] uppercase tracking-wide text-[var(--color-text-muted)]",children:[g.jsx("span",{children:"output"}),g.jsx("span",{className:"tabular text-[var(--color-inflight)]",children:e.tokens.output})]}),g.jsx("div",{className:"squad-inflight squad-inflight--reduce h-1.5 overflow-hidden rounded-full bg-[var(--gray-5)]",children:g.jsx("div",{className:"h-full rounded-full bg-[var(--color-inflight)] transition-[width] duration-300",style:{width:`${c}%`,opacity:.92}})})]})]}),g.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[g.jsx("div",{style:{transform:"scale(0.38)",transformOrigin:"center"},"aria-hidden":!0,className:"-m-14",children:e.cacheHitPct!=null?g.jsx(nP,{ratio:d}):g.jsx("div",{style:{width:140,height:140},className:"rounded-full border-2 border-dashed border-[var(--gray-6)] opacity-80"})}),h?g.jsxs(Ee,{tone:"info","data-testid":"multi-tab-badge",title:"Other browser tabs streaming this same run",children:[g.jsx(rX,{size:12,"aria-hidden":!0,className:"-mt-px"}),"+",e.multiTab.count]}):null]}),l>0?g.jsxs("span",{className:"text-[11px] text-[var(--color-warn)]",children:["+",Math.round(l/1e3),"k tokens over plan meter"]}):null,f?g.jsx(fe,{type:"button",variant:"danger",className:"ml-auto",disabled:r,onClick:()=>n(),children:"Cancel run"}):null]})})}function hTe({rateLimit:e,onRerun:t,onCancel:n,rerunDisabled:r,subscription:i=!1}){const[o,s]=C.useState(()=>Date.now());C.useEffect(()=>{const h=window.setInterval(()=>s(Date.now()),500);return()=>window.clearInterval(h)},[]);const a=Math.floor((o-e.receivedAtMs)/1e3),l=Math.max(0,e.retryAfterSec-a),u=2*Math.PI*42,c=e.retryAfterSec>0?Math.min(1,l/e.retryAfterSec):0,f={anthropic:"https://console.anthropic.com/settings/limits",openai:"https://platform.openai.com/settings/organization/limits",google:"https://aistudio.google.com/app/plan_information"};return g.jsx("div",{"data-testid":"rate-limit-ring",className:"mb-4 rounded-xl border border-[var(--color-info-border)] bg-[var(--color-info-bg)] p-4",children:g.jsxs("div",{className:"flex flex-wrap items-start gap-4",children:[g.jsxs("div",{className:"relative h-24 w-24 shrink-0",children:[g.jsxs("svg",{viewBox:"0 0 100 100",className:"-rotate-90","aria-hidden":!0,children:[g.jsx("circle",{cx:"50",cy:"50",r:"42",stroke:"var(--gray-5)",strokeWidth:"10",fill:"none"}),g.jsx("circle",{cx:"50",cy:"50",r:"42",stroke:"var(--color-info)",strokeWidth:"10",fill:"none",strokeDasharray:u,strokeDashoffset:u*(1-c),className:"transition-[stroke-dashoffset] duration-500"})]}),g.jsxs("div",{className:"pointer-events-none absolute inset-0 flex flex-col items-center justify-center text-center tabular",children:[g.jsxs("span",{className:"text-xl font-semibold text-[var(--color-text)]",children:[l,"s"]}),g.jsx("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:"retry"})]})]}),g.jsxs("div",{className:"min-w-0 flex-1 text-sm",children:[g.jsx("p",{className:"font-semibold text-[var(--color-text)]",children:i?`Claude usage limit reached (${e.phase})`:`${e.provider} rate limit hit (${e.phase})`}),g.jsxs("p",{className:"mt-1 text-[var(--color-text-muted)]",children:["Retry after"," ",g.jsxs("span",{className:"tabular font-medium text-[var(--color-text)]",children:[e.retryAfterSec,"s"]}),".",e.phase==="retrying"?g.jsxs(g.Fragment,{children:[" ","Auto-retrying in ",g.jsxs("span",{className:"tabular",children:[l,"s"]}),"…"]}):g.jsxs(g.Fragment,{children:[" ","Above our ",e.capSec,"s retry cap — run stopped cleanly."]})]}),g.jsxs("details",{className:"mt-2 text-[12px] text-[var(--color-text-muted)]",children:[g.jsx("summary",{className:"cursor-pointer text-[var(--color-text)]",children:"Why this happened"}),g.jsxs("ul",{className:"mt-2 list-disc space-y-1 pl-4",children:[i?g.jsx("li",{children:"Planning draws on the same usage limits as Claude and Claude Code — the window has to reset."}):g.jsx("li",{children:"Provider throttled upstream requests."}),g.jsx("li",{children:"Wait the full backoff before retrying to avoid multiplying 429s."}),g.jsxs("li",{children:[g.jsx(vt,{to:"/config",className:"underline",children:"Config"})," ","lets you shrink model tier or tighten planner budget."]}),i?null:g.jsx("li",{children:g.jsx("a",{href:f[e.provider],className:"underline",target:"_blank",rel:"noreferrer",children:"Provider limits dashboard"})})]})]}),e.phase==="aborted"?g.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[g.jsx(fe,{type:"button",disabled:r||l>0,onClick:t,"data-testid":"rate-limit-rerun",children:l>0?`Wait ${l}s`:"Rerun planner"}),g.jsx(fe,{type:"button",variant:"secondary",onClick:n,children:"Cancel"})]}):null]})]})})}function dTe(){const e=wt({queryKey:["runs","recent"],queryFn:()=>Me("/api/runs"),staleTime:5e3}),t=[...e.data??[]].slice(0,20);return g.jsx("aside",{"data-testid":"recent-runs-drawer",className:"sticky top-20 hidden shrink-0 self-start lg:block lg:w-72 xl:w-[20rem]",children:g.jsxs("div",{className:"max-h-[calc(100vh-140px)] overflow-y-auto rounded-xl border border-[var(--color-border)] bg-[var(--gray-2)] p-2",children:[g.jsx("h2",{className:"px-2 py-2 text-[11px] font-semibold uppercase tracking-wide text-[var(--color-text-muted)]",children:"Recent runs"}),!e.data&&e.isFetching?g.jsx("p",{className:"px-2 text-[12px] text-[var(--color-text-muted)]",children:"Loading…"}):null,e.error?g.jsx("p",{className:"px-2 text-[12px] text-[var(--color-fail)]",children:"Could not load runs."}):null,g.jsx("ul",{className:"space-y-1",children:t.map(n=>g.jsx("li",{children:g.jsxs(vt,{to:"/runs/$runId",params:{runId:n.runId},search:{tab:"plan"},className:"block rounded-lg px-2 py-2 text-[12px] hover:bg-[var(--gray-3)]","data-run-id":n.runId,children:[g.jsxs("div",{className:"flex items-start justify-between gap-2",children:[g.jsxs("span",{className:"font-mono text-[11px] text-[var(--color-text)]",children:[n.feature,"/",n.storyId]}),g.jsx(Ee,{tone:n.success?"success":n.partial?"warning":"danger",className:"shrink-0",children:n.partial?"partial":n.success?"ok":"fail"})]}),g.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-x-2 text-[10px] text-[var(--color-text-muted)]",children:[g.jsx("span",{className:"tabular",children:new Date(n.startedAt).toLocaleString()}),g.jsxs("span",{className:"tabular",children:[Math.round(n.durationMs/1e3),"s"]})]}),g.jsxs("span",{className:"mt-1 inline-block truncate font-mono text-[10px] text-[var(--color-text-muted)]",children:[n.model,n.planFile?` · ${n.planFile}`:""]})]})},n.runId))})]})})}function pTe(e){return e?[e.mode,e.credentialHint,e.apiKeySource].filter(Boolean).join(" · "):"—"}function p8({runtime:e,auth:t=null,telemetryPartial:n}){if(!e)return g.jsx("div",{className:"mb-4 rounded-xl border border-dashed border-[var(--color-border)] bg-[var(--gray-2)] p-4 text-sm text-[var(--color-text-muted)]",children:"Waiting for runtime telemetry…"});const r=e.providerOptions?.anthropic,i=r?.effortByPhase?.draft??r?.effort??null,o=r?.thinking??null;return g.jsxs("div",{className:"mb-4 rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)] p-4 text-sm",children:[g.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g.jsx(Ee,{tone:"muted",children:e.provider}),g.jsx(Ee,{tone:"muted",children:e.runtimeKind}),g.jsx("span",{className:"font-mono text-[13px] text-[var(--color-text)]",children:e.model}),n?g.jsx(Ee,{tone:"warning","data-testid":"telemetry-partial-chip",children:"telemetry partial"}):null]}),g.jsxs("div",{className:"mt-2 flex flex-wrap gap-2",children:[i?g.jsxs(Ee,{tone:"default",children:["effort: ",i]}):null,o&&o!=="disabled"&&o!=="off"?g.jsxs(Ee,{tone:"default",children:["thinking: ",o]}):null]}),g.jsxs("p",{className:"mt-2 text-[11px] text-[var(--color-text-muted)]","data-testid":"run-auth-row",children:[g.jsx("span",{className:"text-[var(--color-text)]",children:"Auth"})," ",pTe(t)]}),g.jsxs("p",{className:"mt-2 text-[11px] text-[var(--color-text-muted)]",children:["cache ",e.cacheEnabled?"on":"off"," · scout ",e.scoutEnabled?"on":"off"," · validation"," ",e.validationEnabled?"on":"off"]})]})}const $a=200,Qy=8192,ao={phase:"idle"},Xy={phase:"idle",runId:null,startedAtMs:null,feature:"",storyId:"",mode:"api",runtime:null,stages:{scout:{...ao},draft:{...ao},validation:{...ao}},tokens:{input:0,output:0,sum:0,ceiling:Qy,perTurn:[]},cacheHitPct:null,cacheHitPctPerTurn:[],budget:{caps:null,fileReadsCompleted:0,contextBytesApprox:0},tools:[],thinking:{blocks:[]},scout:{selected:null,reasoning:null},validation:[],assistantMd:"",planFile:null,rateLimit:null,multiTab:{count:0},activities:[],turn:0,error:null,errorCode:null,auth:null};let Rk=0;function ia(e){return Rk+=1,`${e}-${Rk}`}function mTe(e){return e.length<=$a?[...e]:e.slice(-$a)}function _l(e,t){return mTe([...e,t])}function pN(e,t){for(let n=e.length-1;n>=0;n--){const r=e[n];if(r.type==="tool"&&r.toolCallId===t)return n}return-1}function mN(e,t){for(let n=e.length-1;n>=0;n--)if(e[n].key===t)return n;return-1}function gN(e,t){for(let n=e.length-1;n>=0;n--){const r=e[n];if(r.type==="thinking"&&r.thinkingKey===t)return n}return-1}function am(e,t,n){const r=e.findIndex(s=>s.toolCallId===t),i=r>=0?e[r]:void 0,o=n(i);if(r>=0){const s=[...e];return s[r]=o,s.slice(-$a)}return[...e,o].slice(-$a)}function e1(e){const t=e?.path;return typeof t=="string"?t:void 0}function gTe(e){const t=(e??"").toLowerCase();return t==="read_file"||t==="grep"||t==="list_dir"}function yTe(e,t){return e.validation.phase==="running"?"validation":e.draft.phase==="running"?"draft":e.scout.phase==="running"?"scout":t>=1&&e.draft.phase==="success"?"draft":"scout"}function vTe(){Rk=0}function m8(e,t,n){let r=e;const i=r.phase==="cancelled"||r.phase==="cancelling",o=()=>yTe(r.stages,t.turn??r.turn);if(t.kind==="rate_limit"&&!i&&t.phase&&(r={...r,rateLimit:{provider:t.provider??"anthropic",retryAfterSec:t.retryAfterSec??t.waitSec??0,capSec:t.capSec??90,phase:t.phase,receivedAtMs:n,rawBody:t.rawBody??""},phase:t.phase==="aborted"&&r.phase!=="cancelling"?"failed":r.phase}),t.kind==="runtime_info"){const a=t.budgetCaps??{maxFileReads:500,maxContextBytes:4194304,maxDurationSeconds:3600};r={...r,runtime:{provider:t.provider??"anthropic",model:t.model??"unknown",runtimeKind:t.runtimeKind??"agent-sdk",cacheEnabled:!!t.cacheEnabled,scoutEnabled:!!(t.scoutEnabled??!0),validationEnabled:!!(t.validationEnabled??!0),budgetCaps:a,providerOptions:t.providerOptions},budget:{...r.budget,caps:a}}}if(t.kind==="stage_started"&&t.stage){const l=r.stages[t.stage].phase==="skipped"?"skipped":"running";r={...r,stages:{...r.stages,[t.stage]:{phase:l==="skipped"?"skipped":"running",startedAt:n,durationMs:void 0,errorMessage:void 0}},activities:_l(r.activities,{type:"stage_marker",id:ia("stage"),stage:t.stage})}}if(t.kind==="stage_complete"&&t.stage){const a=!!t.success,l={phase:a?"success":"failed",durationMs:t.durationMs,errorMessage:t.errorMessage,startedAt:r.stages[t.stage].startedAt};r={...r,stages:{...r.stages,[t.stage]:l}},t.stage==="scout"&&!a&&(r={...r,scout:{...r.scout,failed:!0}})}if(t.kind==="scout_result"){const a=typeof t.reasoning=="string"?t.reasoning:"",l=Array.isArray(t.selected)?t.selected:[];r={...r,scout:{selected:l.length?l:null,reasoning:a||null,failed:!1},stages:{...r.stages,scout:r.stages.scout.phase==="idle"?{phase:"success",durationMs:0}:r.stages.scout},activities:_l(r.activities,{type:"scout_decision",id:ia("scout"),stage:"scout",selected:l.length?l:[],reasoning:a})}}const s=()=>o();if(t.kind==="tool_call_started"&&t.toolCallId){const a=e1(t.input);r={...r,tools:am(r.tools,t.toolCallId,()=>({toolCallId:t.toolCallId,turn:t.turn??r.turn,name:t.name??"tool",path:a,kind:"running",startedAtMs:n})),activities:_l(r.activities,{type:"tool",id:ia("tool"),stage:s(),toolCallId:t.toolCallId,turn:t.turn??r.turn,name:t.name??"tool",path:a,rowState:"running"})}}if(t.kind==="tool_call"&&t.toolCall){const a=e1(t.toolCall.input)??e1(t.toolCall.input),l=typeof t.toolCall.name=="string"?t.toolCall.name:"read_file";if(t.toolCallId){r={...r,tools:am(r.tools,t.toolCallId,c=>({toolCallId:t.toolCallId,turn:t.turn??r.turn,name:c?.name??l,path:c?.path??a,kind:c?.kind==="success"||c?.kind==="error"?c.kind:(c?.kind==="running","running"),bytesLoaded:t.bytesLoaded??c?.bytesLoaded,totalBytes:t.totalBytes??c?.totalBytes,durationMs:c?.durationMs,startedAtMs:c?.startedAtMs??n}))};const u=pN(r.activities,t.toolCallId);if(u>=0){const c=r.activities[u],f=[...r.activities];f[u]={...c,bytesLoaded:t.bytesLoaded??c.bytesLoaded,totalBytes:t.totalBytes??c.totalBytes,path:c.path??a},r={...r,activities:f}}}else{const u=`legacy-${ia("id")}`;r={...r,tools:am(r.tools,u,c=>({toolCallId:u,turn:t.turn??r.turn,name:l,path:a,kind:"success",bytesLoaded:t.bytesLoaded,totalBytes:t.totalBytes,startedAtMs:c?.startedAtMs??n})),activities:_l(r.activities,{type:"tool",id:ia("tool"),stage:s(),toolCallId:u,turn:t.turn??r.turn,name:l,path:a,rowState:"success",bytesLoaded:t.bytesLoaded,totalBytes:t.totalBytes})}}}if(t.kind==="tool_call_completed"&&t.toolCallId){const a=!t.isError,l=[...am(r.tools,t.toolCallId,f=>({toolCallId:t.toolCallId,turn:t.turn??r.turn,name:f?.name??t.name??"tool",path:f?.path,kind:a?"success":"error",bytesLoaded:t.bytesLoaded??f?.bytesLoaded,totalBytes:t.totalBytes??f?.totalBytes,durationMs:t.durationMs,errorSnippet:t.errorSnippet??f?.errorSnippet,startedAtMs:f?.startedAtMs??n}))],u=l.find(f=>f.toolCallId===t.toolCallId)?.name??t.name;r={...r,tools:l};const c=pN(r.activities,t.toolCallId);if(c>=0){const f=r.activities[c],h=[...r.activities];h[c]={...f,rowState:a?"success":"error",bytesLoaded:t.bytesLoaded??f.bytesLoaded,totalBytes:t.totalBytes??f.totalBytes,durationMs:t.durationMs,errorSnippet:t.errorSnippet},r={...r,activities:h}}if(a&&gTe(u)){const f=t.bytesLoaded??0;r={...r,budget:{...r.budget,fileReadsCompleted:r.budget.fileReadsCompleted+1,contextBytesApprox:r.budget.contextBytesApprox+f}}}}if(t.kind==="thinking_block_started"&&typeof t.turn=="number"&&typeof t.blockIndex=="number"){const a=`${t.turn}-${t.blockIndex}`,l={key:a,turn:t.turn,blockIndex:t.blockIndex,text:"",state:"running"};r={...r,thinking:{blocks:[...r.thinking.blocks,l].slice(-$a)},activities:_l(r.activities,{type:"thinking",id:ia("think"),stage:s(),thinkingKey:a,turn:t.turn,blockIndex:t.blockIndex,text:"",summaryOnly:!1,rowState:"running"})}}if(t.kind==="thinking_delta"&&typeof t.turn=="number"&&typeof t.blockIndex=="number"){const a=`${t.turn}-${t.blockIndex}`,l=typeof t.delta=="string"?t.delta:"",u=mN(r.thinking.blocks,a);if(u>=0){const f=[...r.thinking.blocks],h=f[u];f[u]={...h,text:l?h.text+l:h.text},r={...r,thinking:{blocks:f}}}const c=gN(r.activities,a);if(c>=0){const f=r.activities[c],h=[...r.activities];h[c]={...f,text:l?f.text+l:f.text,summaryOnly:l===""?!0:f.summaryOnly??!1},r={...r,activities:h}}}if(t.kind==="thinking_block_stopped"&&typeof t.turn=="number"&&typeof t.blockIndex=="number"){const a=`${t.turn}-${t.blockIndex}`,l=typeof t.durationMs=="number"?t.durationMs:0,u=typeof t.chars=="number"?t.chars:0,c=mN(r.thinking.blocks,a);if(c>=0){const h=[...r.thinking.blocks],d=h[c],p=d.text.trim().length===0;h[c]={...d,state:"done",durationMs:l,chars:u,summaryOnly:p},r={...r,thinking:{blocks:h}}}const f=gN(r.activities,a);if(f>=0){const h=r.activities[f],d=h.text.trim().length===0,p=[...r.activities];p[f]={...h,rowState:"done",durationMs:l,chars:u,summaryOnly:d},r={...r,activities:p}}}if(t.kind==="usage"&&t.usage){const a=t.usage.inputTokens??r.tokens.input,l=t.usage.outputTokens??r.tokens.output,u=a+l,c=Math.max(r.tokens.ceiling,Math.ceil(u*1.15),Qy),f=t.turn??r.turn,h=[...r.tokens.perTurn],d=h.findIndex(m=>m.turn===f),p={turn:f,input:a,output:l,sum:u};d>=0?h[d]=p:h.push(p),r={...r,tokens:{input:a,output:l,sum:u,ceiling:c,perTurn:h.slice(-$a)}}}if(t.kind==="cache_summary"&&typeof t.cacheHitRatio=="number"){const a=Math.round(t.cacheHitRatio*100),l=[...r.cacheHitPctPerTurn,a];r={...r,cacheHitPct:a,cacheHitPctPerTurn:l.slice(-$a)}}if(t.kind==="validation_issue"&&t.issueKind&&t.detail){const a={id:ia("val"),severity:t.severity??"warning",issueKind:t.issueKind,path:t.path,detail:t.detail,excerpt:t.excerpt};r={...r,validation:[...r.validation,a],activities:_l(r.activities,{type:"validation_issue",id:a.id,stage:s(),issue:a})}}if(t.kind==="auth_info"&&t.mode&&(r={...r,auth:{mode:t.mode,reason:t.reason,credentialHint:t.credentialHint,apiKeySource:t.apiKeySource??r.auth?.apiKeySource,account:t.account??r.auth?.account}}),t.kind==="assistant_text"&&t.delta&&(r={...r,assistantMd:r.assistantMd+t.delta}),typeof t.turn=="number"&&(r={...r,turn:t.turn}),t.kind==="cancelled"&&(r={...r,phase:"cancelled",rateLimit:null}),t.kind==="done"){if(r.phase==="failed"&&r.error)return r={...r,planFile:t.planFile??r.planFile},r;const a=r.phase==="cancelled"||r.phase==="cancelling";r={...r,planFile:t.planFile??null},t.success?r={...r,phase:"done",error:null,rateLimit:null}:a||t.partial?r={...r,phase:"cancelled"}:r={...r,phase:"failed",error:"Planning did not finish cleanly."}}return t.kind==="error"&&t.message&&(r={...r,phase:"failed",error:t.message,rateLimit:null}),r}function bTe(e,t){switch(t.type){case"set_multi_tab":return{...e,multiTab:{count:t.count}};case"set_story":return{...e,feature:t.feature,storyId:t.storyId};case"set_mode":return{...e,mode:t.mode};case"start_post":return{...e,phase:"starting",error:null,errorCode:null,auth:null,rateLimit:null,assistantMd:"",planFile:null,cacheHitPct:null,cacheHitPctPerTurn:[],activities:[],tools:[],thinking:{blocks:[]},scout:{selected:null,reasoning:null},validation:[],tokens:{input:0,output:0,sum:0,ceiling:Qy,perTurn:[]},budget:{caps:null,fileReadsCompleted:0,contextBytesApprox:0},runtime:null,stages:{scout:{...ao},draft:{...ao},validation:{...ao}},turn:0,startedAtMs:Date.now()};case"start_stream":return{...e,phase:"streaming",runId:t.runId,startedAtMs:e.startedAtMs??Date.now(),rateLimit:null};case"resume":return{...Xy,phase:"streaming",runId:t.runId,feature:t.feature,storyId:t.storyId,mode:"api",startedAtMs:Date.now(),error:null,errorCode:null};case"cancel_requested":return e.phase!=="streaming"&&e.phase!=="starting"?e:{...e,phase:"cancelling"};case"disconnect_stream":return{...e,runId:null,phase:"cancelled",rateLimit:null};case"reset_stream_ui":return{...e,phase:"idle",runId:null,error:null,errorCode:null,auth:null,rateLimit:null,startedAtMs:null,planFile:null,assistantMd:"",activities:[],tools:[],thinking:{blocks:[]},scout:{selected:null,reasoning:null},validation:[],cacheHitPct:null,cacheHitPctPerTurn:[],tokens:{input:0,output:0,sum:0,ceiling:Qy,perTurn:[]},budget:{caps:null,fileReadsCompleted:0,contextBytesApprox:0},runtime:null,stages:{scout:{...ao},draft:{...ao},validation:{...ao}},turn:0};case"reset_all":return Xy;case"fail":return{...e,phase:"failed",error:t.message,errorCode:t.code??null,runId:null};case"sse":return m8(e,t.event,Date.now());default:return e}}function xTe(e,t){C.useEffect(()=>{if(!e)return;const n=sessionStorage.getItem("squad.console.token");if(!n)return;const r=`/api/runs/${encodeURIComponent(e)}/stream?t=${encodeURIComponent(n)}`,i=new EventSource(r),o=(a,l)=>{i.addEventListener(a,u=>l(u.data))},s=a=>{try{const l=JSON.parse(a);t({type:"sse",event:l})}catch{}};return o("stage_started",s),o("stage_complete",s),o("scout_result",s),o("validation_issue",s),o("started",s),o("runtime_info",s),o("auth_info",s),o("turn_started",s),o("request_sent",s),o("usage",s),o("cache_summary",s),o("tool_call",s),o("tool_call_started",s),o("tool_call_completed",s),o("assistant_text",s),o("thinking_delta",s),o("thinking_block_started",s),o("thinking_block_stopped",s),o("rate_limit",s),o("turn_complete",s),o("done",s),o("error",s),o("cancelled",s),o("ping",()=>{}),i.addEventListener("closed",()=>i.close()),()=>i.close()},[e,t])}function wTe(){const[e,t]=C.useReducer(bTe,Xy),[n,r]=C.useState(!1),[i,o]=C.useState(!1),s=C.useRef(""),a=C.useRef(null);a.current=e.runId;const l=C.useRef(new Map),u=C.useCallback(y=>t(y),[]);C.useEffect(()=>{s.current=typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`tab-${Math.random().toString(36).slice(2)}`},[]),xTe(e.runId,u),C.useEffect(()=>{const y=typeof BroadcastChannel<"u"?new BroadcastChannel("squad.generate.runs"):null;if(!y)return;const x=()=>{const O=Date.now();for(const A of[...l.current.keys()])O-l.current.get(A)>14e3&&l.current.delete(A)},k=O=>{const A=O.data,P=a.current;P&&A?.runId===P&&A.clientId&&A.clientId!==s.current&&(A.type==="ping"||A.type==="attach")&&l.current.set(A.clientId,Date.now())};y.addEventListener("message",k);const w=window.setInterval(()=>{const O=a.current;O&&(x(),y.postMessage({type:"ping",runId:O,clientId:s.current}))},5e3),S=window.setInterval(()=>{if(x(),!a.current){t({type:"set_multi_tab",count:0});return}const A=Date.now();let P=0;for(const[M,j]of l.current)A-j<12e3&&(P+=1);t({type:"set_multi_tab",count:P})},750);return a.current&&y.postMessage({type:"attach",runId:a.current,clientId:s.current}),()=>{y.removeEventListener("message",k),window.clearInterval(w),window.clearInterval(S),l.current.clear(),y.close()}},[e.runId]),C.useEffect(()=>{if(!e.runId||e.runtime){r(!1);return}if(e.phase!=="streaming"&&e.phase!=="starting"&&e.phase!=="cancelling"){r(!1);return}const y=window.setTimeout(()=>r(!0),2e3);return()=>window.clearTimeout(y)},[e.runId,e.runtime,e.phase]),C.useEffect(()=>{if(e.phase!=="cancelling"){o(!1);return}const y=window.setTimeout(()=>o(!0),3e4);return()=>window.clearTimeout(y)},[e.phase]),C.useEffect(()=>{let y=!1;return(async()=>{if(e.phase==="idle")try{const x=await Me("/api/runs/active");if(y||x.length!==1)return;const k=x[0];t({type:"resume",runId:k.runId,feature:k.feature,storyId:k.storyId})}catch{}})(),()=>{y=!0}},[e.phase]);const c=C.useCallback((y,x)=>{t({type:"set_story",feature:y,storyId:x})},[]),f=C.useCallback(y=>{t({type:"set_mode",mode:y})},[]),h=C.useCallback(async()=>{if(!(!e.feature||!e.storyId)){t({type:"start_post"});try{const y=await fetch("/api/runs",{method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${sessionStorage.getItem("squad.console.token")??""}`},body:JSON.stringify({feature:e.feature,storyId:e.storyId})});if(y.status===401)throw new kr;if(!y.ok){const k=await y.json().catch(()=>({})),w=new Error(k.detail??k.error??`${y.status}`);throw w.code=k.error,w}const x=await y.json();t({type:"start_stream",runId:x.runId})}catch(y){t({type:"fail",message:y instanceof Error?y.message:String(y),code:y?.code})}}},[e.feature,e.storyId]),d=C.useCallback(async()=>{if(e.runId){t({type:"cancel_requested"});try{await fetch(`/api/runs/${encodeURIComponent(e.runId)}`,{method:"DELETE",headers:{authorization:`Bearer ${sessionStorage.getItem("squad.console.token")??""}`}})}catch{}}},[e.runId]),p=C.useCallback(()=>{t({type:"disconnect_stream"})},[]),m=C.useCallback(()=>{t({type:"reset_all"})},[]),v=C.useCallback(()=>{t({type:"reset_stream_ui"})},[]);return{state:C.useMemo(()=>({...e,telemetryPartialUi:n&&!e.runtime,stopWatchingShown:i}),[e,n,i]),setStory:c,setMode:f,start:h,cancel:d,disconnectStreamOnly:p,reset:m,resetStreamingUiOnly:v,dispatchReduce:t}}function yN(e){return e==="success"||e==="failed"||e==="skipped"}function g8({stages:e,onJump:t}){const n=["scout","draft","validation"],r={scout:"Scout",draft:"Draft",validation:"Validation"},i=s=>{const a="relative flex flex-1 items-center justify-center rounded-lg border px-2 py-3 text-[11px] font-semibold uppercase tracking-wide cursor-pointer overflow-hidden transition-colors focus-visible:ring-2";return s==="running"?`${a} squad-node-running border-[var(--color-inflight)] text-[var(--color-text)]`:s==="success"?`${a} bg-[rgba(34,197,94,0.07)] border-[var(--color-ok-border)] text-[var(--color-ok)]`:s==="failed"?`${a} bg-[rgba(239,68,68,0.07)] border-[var(--color-fail-border)] text-[var(--color-fail)]`:s==="skipped"?`${a} squad-node-skipped border-[var(--color-border)] text-[var(--color-text-muted)]`:`${a} border-[var(--color-border)] bg-[var(--gray-3)] text-[var(--color-text-muted)]`},o=(s,a)=>{const l=yN(e[s].phase)&&yN(e[a].phase);return e[a].phase==="running"?"flex-1 h-px bg-[var(--color-inflight)] opacity-70":l&&e[a].phase==="success"?"flex-1 h-px bg-[var(--color-ok)]":"flex-1 h-px bg-[var(--gray-6)]"};return g.jsx("div",{"data-testid":"stage-pipeline",className:"mb-4 rounded-xl border border-[var(--color-border)] bg-[var(--gray-2)] p-3",children:g.jsx("div",{className:"flex items-center gap-1 md:gap-2",children:n.map((s,a)=>{let l=null;if(a<n.length-1){const u=n[a+1];l=g.jsx("div",{role:"presentation",className:o(s,u)},`conn-${s}`)}return g.jsxs(C.Fragment,{children:[g.jsxs("button",{type:"button",className:`${i(e[s].phase)}`,"aria-label":`${r[s]} stage`,onClick:()=>t(s),children:[e[s].phase==="running"?g.jsx("span",{className:"squad-stage-sweep squad-stage-sweep--reduce pointer-events-none absolute inset-0"}):null,g.jsx("span",{className:"relative z-[1]",children:r[s]})]}),l]},s)})})})}function xP({command:e,className:t=""}){const{toast:n}=Qr();async function r(){try{await navigator.clipboard.writeText(e),n({tone:"success",title:"Command copied"})}catch{n({tone:"warning",title:"Clipboard blocked",description:"Select the command manually."})}}return g.jsxs("div",{className:`flex flex-wrap items-center gap-2 ${t}`,children:[g.jsx("code",{className:"rounded bg-[var(--gray-3)] px-2 py-1 font-mono text-[12px] text-[var(--color-text)]",children:e}),g.jsx(fe,{type:"button",variant:"secondary",size:"sm",leftIcon:g.jsx(QC,{size:14,"aria-hidden":!0}),onClick:()=>void r(),children:"Copy"})]})}const rb=["planner-auth"];function wP(){return wt({queryKey:rb,queryFn:()=>Me("/api/planner-auth")})}function STe(){const e=yi();return Ps({mutationFn:()=>Me("/api/planner-auth?probe=1"),onSuccess:t=>e.setQueryData(rb,t)})}function kTe(e){return e?e.probe?.ran&&!e.probe.ok?e.login.present:e.loggedIn:!1}function OTe(e){return!e?.probe?.ran||e.probe.ok?null:e.probe.kind==="timeout"?"Could not verify (timed out)":"Could not verify"}function CTe(e){const t=e?.account;if(!t)return null;const n=[t.email,t.organization,t.subscriptionType].filter(Boolean);return n.length>0?n.join(" · "):null}function y8(e){const t=e.split(/[/\\]/).pop();return t&&t.length>0?t:e}function ATe({run:e,unplanned:t,featureNames:n,plannerEnabled:r}){return g.jsxs("div",{className:"flex flex-wrap items-end gap-4",children:[g.jsxs("label",{className:"flex min-w-[140px] flex-col gap-1 text-xs text-[var(--color-text-muted)]",children:["Feature",g.jsxs(La,{value:e.state.feature,disabled:n.length===0,onChange:i=>{const o=i.target.value,s=t.find(a=>a.feature===o);e.setStory(o,s?.id??"")},children:[g.jsx("option",{value:"",children:"—"}),n.map(i=>g.jsx("option",{value:i,children:i},i))]})]}),g.jsxs("label",{className:"flex min-w-[180px] flex-col gap-1 text-xs text-[var(--color-text-muted)]",children:["Story",g.jsxs(La,{value:e.state.storyId,disabled:!e.state.feature,onChange:i=>e.setStory(e.state.feature,i.target.value),children:[g.jsx("option",{value:"",children:"—"}),t.filter(i=>i.feature===e.state.feature).map(i=>g.jsxs("option",{value:i.id,children:[i.id,i.titleHint?` — ${i.titleHint}`:""]},`${i.feature}/${i.id}`))]})]}),g.jsxs("fieldset",{className:"flex gap-4 text-sm text-[var(--color-text)]",children:[g.jsx("legend",{className:"sr-only",children:"Mode"}),g.jsxs("label",{className:"flex cursor-pointer items-center gap-2",children:[g.jsx("input",{type:"radio",name:"mode",checked:e.state.mode==="api",disabled:!r,onChange:()=>e.setMode("api")}),"API"]}),g.jsxs("label",{className:"flex cursor-pointer items-center gap-2",children:[g.jsx("input",{type:"radio",name:"mode",checked:e.state.mode==="copy",onChange:()=>e.setMode("copy")}),"Copy"]})]}),g.jsx(fe,{type:"button",disabled:!e.state.feature||!e.state.storyId||e.state.mode!=="api"||!r||e.state.phase==="streaming"||e.state.phase==="starting"||e.state.phase==="cancelling",onClick:()=>void e.start(),children:"Run"})]})}function PTe({feature:e,storyId:t,q:n}){const{toast:r}=Qr();if(!e||!t)return g.jsx(Ae,{tone:"info",title:"Choose a story first",children:"Pick a feature and story above before loading the meta-prompt."});if(n.isLoading)return g.jsxs("div",{className:"flex items-center gap-2 text-sm text-[var(--color-text-muted)]",children:[g.jsx(Yd,{}),"Building prompt…"]});if(n.isError)return g.jsx(Ae,{tone:"danger",title:"Could not load prompt",children:n.error instanceof Error?n.error.message:String(n.error)});const i=n.data;return g.jsxs("div",{className:"mt-6 space-y-4",children:[g.jsx(Ae,{tone:"info",title:"Copy-paste planning (no API spend here)",children:g.jsxs("ol",{className:"mt-2 list-decimal space-y-1.5 pl-4 text-sm text-[var(--color-text-muted)]",children:[g.jsxs("li",{children:["Click ",g.jsx("strong",{className:"text-[var(--color-text)]",children:"Copy full prompt"})," (or select the textarea)."]}),g.jsx("li",{children:"Open your agent and paste."})]})}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[g.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["~",i.estTokensApprox.toLocaleString()," tokens (est) · ",(i.bytes/1024).toFixed(1)," KB"]}),g.jsx(fe,{type:"button",variant:"secondary",leftIcon:g.jsx(QC,{size:14,"aria-hidden":!0}),onClick:()=>{(async()=>{try{await navigator.clipboard.writeText(i.prompt),r({tone:"success",title:"Full prompt copied"})}catch{r({tone:"warning",title:"Clipboard blocked",description:"Select the text manually."})}})()},children:"Copy full prompt"})]}),g.jsxs("div",{children:[g.jsx("label",{className:"text-xs font-medium text-[var(--color-text-muted)]",htmlFor:"copy-prompt-preview",children:"Prompt preview"}),g.jsx("textarea",{id:"copy-prompt-preview",readOnly:!0,spellCheck:!1,rows:14,className:"mt-1 w-full max-h-64 min-h-[12rem] resize-y rounded-lg border border-[var(--color-border)] bg-[var(--gray-2)] p-3 font-mono text-[11px]",value:i.prompt})]})]})}function vN({tone:e,title:t,feature:n,planFile:r}){return g.jsx(Ae,{tone:e==="success"?"success":"warning",title:t,action:g.jsx(vt,{to:"/plans/$feature/$planFile",params:{feature:n,planFile:y8(r)},className:"text-[13px] font-medium text-[var(--color-accent)] hover:underline",children:"Open"}),children:g.jsx("span",{className:"font-mono",children:r})})}function ETe({mode:e,credentialHint:t,apiKeySource:n}){if(!e)return null;const r=[t,n?`apiKeySource: ${n}`:null].filter(Boolean).join(" · ");return g.jsx(Ee,{tone:e==="subscription"?"info":"muted",title:r||void 0,"data-testid":"generate-auth-badge",children:e==="subscription"?"Subscription":"API key"})}function TTe({mode:e}){return e==="subscription"?g.jsx(Ae,{tone:"info",title:"Runs on your Claude subscription",children:"API runs here draw on your Claude usage limits — there is no per-token API bill. Agent SDK usage counts against the same limits as Claude and Claude Code, so a long planning run consumes part of your window. Hitting the limit means waiting for the reset, not a larger invoice."}):g.jsxs(Ae,{tone:"info",title:"Provider keys",children:[g.jsxs("p",{children:["API runs need a provider key in"," ",g.jsx(vt,{to:"/secrets",className:"text-[var(--color-accent)] underline",children:"Secrets"})," ","or ",g.jsx("code",{className:"text-xs",children:"ANTHROPIC_API_KEY"}),", etc."]}),g.jsx("p",{className:"mt-1",children:"Each model round is billed like any other API usage (input tokens, output tokens, and cache-related tokens when applicable)."})]})}function _Te(){const e=wTe(),t=e.state,{feature:n,storyId:r}=Ec({from:"/generate"}),i=n&&r?`${n}:${r}`:"",o=C.useRef(null),s=wt({queryKey:["stories"],queryFn:()=>Me("/api/stories")}),a=wt({queryKey:["config"],queryFn:()=>Me("/api/config")}),l=wP(),u=!!a.data?.planner?.enabled,c=t.auth?.mode??l.data?.resolved?.mode??null,f=t.auth?.credentialHint??l.data?.resolved?.credentialHint,h=t.auth?.apiKeySource??l.data?.apiKeySource??void 0,d=l.data?.loginCommand??"squad auth login",p=wt({queryKey:["copy-plan-prompt",t.feature,t.storyId],queryFn:()=>Me(`/api/copy-plan-prompt?feature=${encodeURIComponent(t.feature)}&storyId=${encodeURIComponent(t.storyId)}`),enabled:t.mode==="copy"&&!!(t.feature&&t.storyId)}),m=C.useMemo(()=>(s.data??[]).filter(A=>!A.planFile),[s.data]),v=C.useMemo(()=>wz(m).map(A=>A.feature),[m]);C.useEffect(()=>{if(!m.length)return;if(i&&i!==o.current){const P=m.find(M=>M.feature===n&&M.id===r);if(P){e.setStory(P.feature,P.id),o.current=i;return}o.current=i}if(t.feature)return;const A=[...m].sort((P,M)=>{const j=`${P.feature}/${P.id}`;return`${M.feature}/${M.id}`.localeCompare(j)})[0];A&&e.setStory(A.feature,A.id)},[m,t.feature,i,n,r,e]);const[,b]=C.useState(0);C.useEffect(()=>{if(t.phase!=="streaming"&&t.phase!=="starting"&&t.phase!=="cancelling"&&t.phase!=="done"&&t.phase!=="failed"&&t.phase!=="cancelled")return;const A=window.setInterval(()=>b(P=>P+1),500);return()=>window.clearInterval(A)},[t.phase]);const y=t.startedAtMs!=null?Math.floor((Date.now()-t.startedAtMs)/1e3):0,[x,k]=C.useState(null),w=C.useCallback(A=>{k(A),window.setTimeout(()=>k(null),300)},[]);if(s.error instanceof kr||a.error instanceof kr||p.error instanceof kr)return g.jsx(Ce,{title:"Generate plan",description:"Run the planner against an intake; monitor every step live.",children:g.jsxs(Ae,{tone:"warning",title:"Session expired or missing token.",children:["Reopen ",g.jsx("kbd",{className:"kbd",children:"squad console"})," from your project."]})});const O=t.mode==="api"&&(t.phase==="streaming"||t.phase==="starting"||t.phase==="cancelling"||t.phase==="done"||t.phase==="failed"||t.phase==="cancelled");return g.jsx(Ce,{title:"Generate plan",description:"Run the planner against an intake; monitor every step live.",children:g.jsxs("div",{className:"lg:flex lg:items-start lg:gap-8",children:[g.jsxs("div",{className:"min-w-0 flex-1",children:[!u&&g.jsxs(Ae,{tone:"warning",title:"Planner API is not enabled in config.",children:["Run ",g.jsx("code",{className:"text-xs",children:"squad config set planner"})," or open the"," ",g.jsx(vt,{to:"/config",className:"text-[var(--color-accent)] underline",children:"Config"})," ","tab."]}),u&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:g.jsx(ETe,{mode:c,credentialHint:f,apiKeySource:h})}),g.jsx(TTe,{mode:c})]}),g.jsx(ATe,{run:e,unplanned:m,featureNames:v,plannerEnabled:u}),t.mode==="copy"?g.jsx(PTe,{feature:t.feature,storyId:t.storyId,q:p}):g.jsxs(g.Fragment,{children:[O?g.jsxs(g.Fragment,{children:[g.jsx(d8,{state:t,elapsedSec:y,onCancel:()=>void e.cancel()}),g.jsx(p8,{runtime:t.runtime,auth:t.auth,telemetryPartial:e.state.telemetryPartialUi}),t.phase==="cancelling"?g.jsxs(Ae,{tone:"info",title:"Cancelling…",children:["Still receiving from provider. Anthropic Agent SDK may take a few seconds to close the upstream HTTP.",e.state.stopWatchingShown?g.jsx("div",{className:"mt-2 flex gap-2",children:g.jsx(fe,{type:"button",variant:"secondary",onClick:()=>e.disconnectStreamOnly(),children:"Stop watching"})}):null]}):null,g.jsx(g8,{stages:t.stages,onJump:w}),g.jsx(f8,{budget:t.budget,startedAtMs:t.startedAtMs}),t.rateLimit?g.jsx(hTe,{rateLimit:t.rateLimit,subscription:c==="subscription",onRerun:()=>void e.start(),onCancel:()=>{e.cancel(),e.resetStreamingUiOnly()},rerunDisabled:t.phase==="streaming"||t.phase==="starting"||t.phase==="cancelling"||!t.feature||!t.storyId}):null,g.jsxs("div",{className:"grid gap-4 lg:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]",children:[g.jsx(c8,{rows:t.activities,jumpStage:x}),g.jsx(h8,{state:t})]})]}):null,t.phase==="done"&&t.planFile?g.jsx(vN,{tone:"success",title:"Plan saved",feature:t.feature,planFile:t.planFile}):null,t.phase==="cancelled"&&t.planFile?g.jsx(vN,{tone:"warning",title:"Saved partial plan",feature:t.feature,planFile:t.planFile}):null,t.errorCode==="auth_unavailable"&&t.phase==="failed"?g.jsxs(Ae,{tone:"danger",title:"No Claude credential available",children:[g.jsx("p",{children:t.error}),g.jsx(xP,{className:"mt-2",command:d}),g.jsxs("p",{className:"mt-2",children:[g.jsx(vt,{to:"/config",className:"text-[var(--color-accent)] underline",children:"Configure auth"})," ","to switch between your Claude subscription and an API key."]})]}):t.error&&t.phase==="failed"&&!t.rateLimit?g.jsx(Ae,{tone:"danger",title:"Run failed",children:t.error}):null]})]}),g.jsx(dTe,{})]})})}/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */function v8(e){return typeof e>"u"||e===null}function jTe(e){return typeof e=="object"&&e!==null}function MTe(e){return Array.isArray(e)?e:v8(e)?[]:[e]}function ITe(e,t){var n,r,i,o;if(t)for(o=Object.keys(t),n=0,r=o.length;n<r;n+=1)i=o[n],e[i]=t[i];return e}function NTe(e,t){var n="",r;for(r=0;r<t;r+=1)n+=e;return n}function RTe(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var DTe=v8,LTe=jTe,$Te=MTe,BTe=NTe,FTe=RTe,zTe=ITe,Ht={isNothing:DTe,isObject:LTe,toArray:$Te,repeat:BTe,isNegativeZero:FTe,extend:zTe};function b8(e,t){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+=`
|
|
399
|
-
|
|
400
|
-
`+e.mark.snippet),r+" "+n):r}function Od(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=b8(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Od.prototype=Object.create(Error.prototype);Od.prototype.constructor=Od;Od.prototype.toString=function(t){return this.name+": "+b8(this,t)};var _n=Od;function t1(e,t,n,r,i){var o="",s="",a=Math.floor(i/2)-1;return r-t>a&&(o=" ... ",t=r-a+o.length),n-r>a&&(s=" ...",n=r+a-s.length),{str:o+e.slice(t,n).replace(/\t/g,"→")+s,pos:r-t+o.length}}function n1(e,t){return Ht.repeat(" ",t-e.length)+e}function WTe(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],i=[],o,s=-1;o=n.exec(e.buffer);)i.push(o.index),r.push(o.index+o[0].length),e.position<=o.index&&s<0&&(s=r.length-2);s<0&&(s=r.length-1);var a="",l,u,c=Math.min(e.line+t.linesAfter,i.length).toString().length,f=t.maxLength-(t.indent+c+3);for(l=1;l<=t.linesBefore&&!(s-l<0);l++)u=t1(e.buffer,r[s-l],i[s-l],e.position-(r[s]-r[s-l]),f),a=Ht.repeat(" ",t.indent)+n1((e.line-l+1).toString(),c)+" | "+u.str+`
|
|
401
|
-
`+a;for(u=t1(e.buffer,r[s],i[s],e.position,f),a+=Ht.repeat(" ",t.indent)+n1((e.line+1).toString(),c)+" | "+u.str+`
|
|
402
|
-
`,a+=Ht.repeat("-",t.indent+c+3+u.pos)+`^
|
|
403
|
-
`,l=1;l<=t.linesAfter&&!(s+l>=i.length);l++)u=t1(e.buffer,r[s+l],i[s+l],e.position-(r[s]-r[s+l]),f),a+=Ht.repeat(" ",t.indent)+n1((e.line+l+1).toString(),c)+" | "+u.str+`
|
|
404
|
-
`;return a.replace(/\n$/,"")}var UTe=WTe,HTe=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],VTe=["scalar","sequence","mapping"];function qTe(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function KTe(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(HTe.indexOf(n)===-1)throw new _n('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=qTe(t.styleAliases||null),VTe.indexOf(this.kind)===-1)throw new _n('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var cn=KTe;function bN(e,t){var n=[];return e[t].forEach(function(r){var i=n.length;n.forEach(function(o,s){o.tag===r.tag&&o.kind===r.kind&&o.multi===r.multi&&(i=s)}),n[i]=r}),n}function GTe(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function r(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}function Dk(e){return this.extend(e)}Dk.prototype.extend=function(t){var n=[],r=[];if(t instanceof cn)r.push(t);else if(Array.isArray(t))r=r.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(n=n.concat(t.implicit)),t.explicit&&(r=r.concat(t.explicit));else throw new _n("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(o){if(!(o instanceof cn))throw new _n("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new _n("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new _n("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(o){if(!(o instanceof cn))throw new _n("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(Dk.prototype);return i.implicit=(this.implicit||[]).concat(n),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=bN(i,"implicit"),i.compiledExplicit=bN(i,"explicit"),i.compiledTypeMap=GTe(i.compiledImplicit,i.compiledExplicit),i};var x8=Dk,w8=new cn("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),S8=new cn("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),k8=new cn("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),O8=new x8({explicit:[w8,S8,k8]});function QTe(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function XTe(){return null}function YTe(e){return e===null}var C8=new cn("tag:yaml.org,2002:null",{kind:"scalar",resolve:QTe,construct:XTe,predicate:YTe,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function ZTe(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function JTe(e){return e==="true"||e==="True"||e==="TRUE"}function e2e(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var A8=new cn("tag:yaml.org,2002:bool",{kind:"scalar",resolve:ZTe,construct:JTe,predicate:e2e,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function t2e(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function n2e(e){return 48<=e&&e<=55}function r2e(e){return 48<=e&&e<=57}function i2e(e){if(e===null)return!1;var t=e.length,n=0,r=!1,i;if(!t)return!1;if(i=e[n],(i==="-"||i==="+")&&(i=e[++n]),i==="0"){if(n+1===t)return!0;if(i=e[++n],i==="b"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!t2e(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!n2e(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;n<t;n++)if(i=e[n],i!=="_"){if(!r2e(e.charCodeAt(n)))return!1;r=!0}return!(!r||i==="_")}function o2e(e){var t=e,n=1,r;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),r=t[0],(r==="-"||r==="+")&&(r==="-"&&(n=-1),t=t.slice(1),r=t[0]),t==="0")return 0;if(r==="0"){if(t[1]==="b")return n*parseInt(t.slice(2),2);if(t[1]==="x")return n*parseInt(t.slice(2),16);if(t[1]==="o")return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function s2e(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Ht.isNegativeZero(e)}var P8=new cn("tag:yaml.org,2002:int",{kind:"scalar",resolve:i2e,construct:o2e,predicate:s2e,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),a2e=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function l2e(e){return!(e===null||!a2e.test(e)||e[e.length-1]==="_")}function u2e(e){var t,n;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:n*parseFloat(t,10)}var c2e=/^[-+]?[0-9]+e/;function f2e(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Ht.isNegativeZero(e))return"-0.0";return n=e.toString(10),c2e.test(n)?n.replace("e",".e"):n}function h2e(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Ht.isNegativeZero(e))}var E8=new cn("tag:yaml.org,2002:float",{kind:"scalar",resolve:l2e,construct:u2e,predicate:h2e,represent:f2e,defaultStyle:"lowercase"}),T8=O8.extend({implicit:[C8,A8,P8,E8]}),_8=T8,j8=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),M8=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function d2e(e){return e===null?!1:j8.exec(e)!==null||M8.exec(e)!==null}function p2e(e){var t,n,r,i,o,s,a,l=0,u=null,c,f,h;if(t=j8.exec(e),t===null&&(t=M8.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(o=+t[4],s=+t[5],a=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(c=+t[10],f=+(t[11]||0),u=(c*60+f)*6e4,t[9]==="-"&&(u=-u)),h=new Date(Date.UTC(n,r,i,o,s,a,l)),u&&h.setTime(h.getTime()-u),h}function m2e(e){return e.toISOString()}var I8=new cn("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:d2e,construct:p2e,instanceOf:Date,represent:m2e});function g2e(e){return e==="<<"||e===null}var N8=new cn("tag:yaml.org,2002:merge",{kind:"scalar",resolve:g2e}),SP=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
405
|
-
\r`;function y2e(e){if(e===null)return!1;var t,n,r=0,i=e.length,o=SP;for(n=0;n<i;n++)if(t=o.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8===0}function v2e(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,o=SP,s=0,a=[];for(t=0;t<i;t++)t%4===0&&t&&(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)),s=s<<6|o.indexOf(r.charAt(t));return n=i%4*6,n===0?(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)):n===18?(a.push(s>>10&255),a.push(s>>2&255)):n===12&&a.push(s>>4&255),new Uint8Array(a)}function b2e(e){var t="",n=0,r,i,o=e.length,s=SP;for(r=0;r<o;r++)r%3===0&&r&&(t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]),n=(n<<8)+e[r];return i=o%3,i===0?(t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]):i===2?(t+=s[n>>10&63],t+=s[n>>4&63],t+=s[n<<2&63],t+=s[64]):i===1&&(t+=s[n>>2&63],t+=s[n<<4&63],t+=s[64],t+=s[64]),t}function x2e(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var R8=new cn("tag:yaml.org,2002:binary",{kind:"scalar",resolve:y2e,construct:v2e,predicate:x2e,represent:b2e}),w2e=Object.prototype.hasOwnProperty,S2e=Object.prototype.toString;function k2e(e){if(e===null)return!0;var t=[],n,r,i,o,s,a=e;for(n=0,r=a.length;n<r;n+=1){if(i=a[n],s=!1,S2e.call(i)!=="[object Object]")return!1;for(o in i)if(w2e.call(i,o))if(!s)s=!0;else return!1;if(!s)return!1;if(t.indexOf(o)===-1)t.push(o);else return!1}return!0}function O2e(e){return e!==null?e:[]}var D8=new cn("tag:yaml.org,2002:omap",{kind:"sequence",resolve:k2e,construct:O2e}),C2e=Object.prototype.toString;function A2e(e){if(e===null)return!0;var t,n,r,i,o,s=e;for(o=new Array(s.length),t=0,n=s.length;t<n;t+=1){if(r=s[t],C2e.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;o[t]=[i[0],r[i[0]]]}return!0}function P2e(e){if(e===null)return[];var t,n,r,i,o,s=e;for(o=new Array(s.length),t=0,n=s.length;t<n;t+=1)r=s[t],i=Object.keys(r),o[t]=[i[0],r[i[0]]];return o}var L8=new cn("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:A2e,construct:P2e}),E2e=Object.prototype.hasOwnProperty;function T2e(e){if(e===null)return!0;var t,n=e;for(t in n)if(E2e.call(n,t)&&n[t]!==null)return!1;return!0}function _2e(e){return e!==null?e:{}}var $8=new cn("tag:yaml.org,2002:set",{kind:"mapping",resolve:T2e,construct:_2e}),kP=_8.extend({implicit:[I8,N8],explicit:[R8,D8,L8,$8]}),_s=Object.prototype.hasOwnProperty,Yy=1,B8=2,F8=3,Zy=4,r1=1,j2e=2,xN=3,M2e=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,I2e=/[\x85\u2028\u2029]/,N2e=/[,\[\]\{\}]/,z8=/^(?:!|!!|![a-z\-]+!)$/i,W8=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function wN(e){return Object.prototype.toString.call(e)}function qi(e){return e===10||e===13}function Ba(e){return e===9||e===32}function Kn(e){return e===9||e===32||e===10||e===13}function ou(e){return e===44||e===91||e===93||e===123||e===125}function R2e(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function D2e(e){return e===120?2:e===117?4:e===85?8:0}function L2e(e){return 48<=e&&e<=57?e-48:-1}function SN(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
406
|
-
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function $2e(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function U8(e,t,n){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}var H8=new Array(256),V8=new Array(256);for(var jl=0;jl<256;jl++)H8[jl]=SN(jl)?1:0,V8[jl]=SN(jl);function B2e(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||kP,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function q8(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=UTe(n),new _n(t,n)}function ce(e,t){throw q8(e,t)}function Jy(e,t){e.onWarning&&e.onWarning.call(null,q8(e,t))}var kN={YAML:function(t,n,r){var i,o,s;t.version!==null&&ce(t,"duplication of %YAML directive"),r.length!==1&&ce(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&ce(t,"ill-formed argument of the YAML directive"),o=parseInt(i[1],10),s=parseInt(i[2],10),o!==1&&ce(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&Jy(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var i,o;r.length!==2&&ce(t,"TAG directive accepts exactly two arguments"),i=r[0],o=r[1],z8.test(i)||ce(t,"ill-formed tag handle (first argument) of the TAG directive"),_s.call(t.tagMap,i)&&ce(t,'there is a previously declared suffix for "'+i+'" tag handle'),W8.test(o)||ce(t,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{ce(t,"tag prefix is malformed: "+o)}t.tagMap[i]=o}};function ks(e,t,n,r){var i,o,s,a;if(t<n){if(a=e.input.slice(t,n),r)for(i=0,o=a.length;i<o;i+=1)s=a.charCodeAt(i),s===9||32<=s&&s<=1114111||ce(e,"expected valid JSON character");else M2e.test(a)&&ce(e,"the stream contains non-printable characters");e.result+=a}}function ON(e,t,n,r){var i,o,s,a;for(Ht.isObject(n)||ce(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),s=0,a=i.length;s<a;s+=1)o=i[s],_s.call(t,o)||(U8(t,o,n[o]),r[o]=!0)}function su(e,t,n,r,i,o,s,a,l){var u,c;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),u=0,c=i.length;u<c;u+=1)Array.isArray(i[u])&&ce(e,"nested arrays are not supported inside keys"),typeof i=="object"&&wN(i[u])==="[object Object]"&&(i[u]="[object Object]");if(typeof i=="object"&&wN(i)==="[object Object]"&&(i="[object Object]"),i=String(i),t===null&&(t={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(o))for(u=0,c=o.length;u<c;u+=1)ON(e,t,o[u],n);else ON(e,t,o,n);else!e.json&&!_s.call(n,i)&&_s.call(t,i)&&(e.line=s||e.line,e.lineStart=a||e.lineStart,e.position=l||e.position,ce(e,"duplicated mapping key")),U8(t,i,o),delete n[i];return t}function OP(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):ce(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function Dt(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;Ba(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(qi(i))for(OP(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&Jy(e,"deficient indentation"),r}function ib(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||Kn(n)))}function CP(e,t){t===1?e.result+=" ":t>1&&(e.result+=Ht.repeat(`
|
|
407
|
-
`,t-1))}function F2e(e,t,n){var r,i,o,s,a,l,u,c,f=e.kind,h=e.result,d;if(d=e.input.charCodeAt(e.position),Kn(d)||ou(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(i=e.input.charCodeAt(e.position+1),Kn(i)||n&&ou(i)))return!1;for(e.kind="scalar",e.result="",o=s=e.position,a=!1;d!==0;){if(d===58){if(i=e.input.charCodeAt(e.position+1),Kn(i)||n&&ou(i))break}else if(d===35){if(r=e.input.charCodeAt(e.position-1),Kn(r))break}else{if(e.position===e.lineStart&&ib(e)||n&&ou(d))break;if(qi(d))if(l=e.line,u=e.lineStart,c=e.lineIndent,Dt(e,!1,-1),e.lineIndent>=t){a=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=l,e.lineStart=u,e.lineIndent=c;break}}a&&(ks(e,o,s,!1),CP(e,e.line-l),o=s=e.position,a=!1),Ba(d)||(s=e.position+1),d=e.input.charCodeAt(++e.position)}return ks(e,o,s,!1),e.result?!0:(e.kind=f,e.result=h,!1)}function z2e(e,t){var n,r,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(ks(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else qi(n)?(ks(e,r,i,!0),CP(e,Dt(e,!1,t)),r=i=e.position):e.position===e.lineStart&&ib(e)?ce(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);ce(e,"unexpected end of the stream within a single quoted scalar")}function W2e(e,t){var n,r,i,o,s,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return ks(e,n,e.position,!0),e.position++,!0;if(a===92){if(ks(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),qi(a))Dt(e,!1,t);else if(a<256&&H8[a])e.result+=V8[a],e.position++;else if((s=D2e(a))>0){for(i=s,o=0;i>0;i--)a=e.input.charCodeAt(++e.position),(s=R2e(a))>=0?o=(o<<4)+s:ce(e,"expected hexadecimal character");e.result+=$2e(o),e.position++}else ce(e,"unknown escape sequence");n=r=e.position}else qi(a)?(ks(e,n,r,!0),CP(e,Dt(e,!1,t)),n=r=e.position):e.position===e.lineStart&&ib(e)?ce(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}ce(e,"unexpected end of the stream within a double quoted scalar")}function U2e(e,t){var n=!0,r,i,o,s=e.tag,a,l=e.anchor,u,c,f,h,d,p=Object.create(null),m,v,b,y;if(y=e.input.charCodeAt(e.position),y===91)c=93,d=!1,a=[];else if(y===123)c=125,d=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),y=e.input.charCodeAt(++e.position);y!==0;){if(Dt(e,!0,t),y=e.input.charCodeAt(e.position),y===c)return e.position++,e.tag=s,e.anchor=l,e.kind=d?"mapping":"sequence",e.result=a,!0;n?y===44&&ce(e,"expected the node content, but found ','"):ce(e,"missed comma between flow collection entries"),v=m=b=null,f=h=!1,y===63&&(u=e.input.charCodeAt(e.position+1),Kn(u)&&(f=h=!0,e.position++,Dt(e,!0,t))),r=e.line,i=e.lineStart,o=e.position,pc(e,t,Yy,!1,!0),v=e.tag,m=e.result,Dt(e,!0,t),y=e.input.charCodeAt(e.position),(h||e.line===r)&&y===58&&(f=!0,y=e.input.charCodeAt(++e.position),Dt(e,!0,t),pc(e,t,Yy,!1,!0),b=e.result),d?su(e,a,p,v,m,b,r,i,o):f?a.push(su(e,null,p,v,m,b,r,i,o)):a.push(m),Dt(e,!0,t),y=e.input.charCodeAt(e.position),y===44?(n=!0,y=e.input.charCodeAt(++e.position)):n=!1}ce(e,"unexpected end of the stream within a flow collection")}function H2e(e,t){var n,r,i=r1,o=!1,s=!1,a=t,l=0,u=!1,c,f;if(f=e.input.charCodeAt(e.position),f===124)r=!1;else if(f===62)r=!0;else return!1;for(e.kind="scalar",e.result="";f!==0;)if(f=e.input.charCodeAt(++e.position),f===43||f===45)r1===i?i=f===43?xN:j2e:ce(e,"repeat of a chomping mode identifier");else if((c=L2e(f))>=0)c===0?ce(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?ce(e,"repeat of an indentation width identifier"):(a=t+c-1,s=!0);else break;if(Ba(f)){do f=e.input.charCodeAt(++e.position);while(Ba(f));if(f===35)do f=e.input.charCodeAt(++e.position);while(!qi(f)&&f!==0)}for(;f!==0;){for(OP(e),e.lineIndent=0,f=e.input.charCodeAt(e.position);(!s||e.lineIndent<a)&&f===32;)e.lineIndent++,f=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>a&&(a=e.lineIndent),qi(f)){l++;continue}if(e.lineIndent<a){i===xN?e.result+=Ht.repeat(`
|
|
408
|
-
`,o?1+l:l):i===r1&&o&&(e.result+=`
|
|
409
|
-
`);break}for(r?Ba(f)?(u=!0,e.result+=Ht.repeat(`
|
|
410
|
-
`,o?1+l:l)):u?(u=!1,e.result+=Ht.repeat(`
|
|
411
|
-
`,l+1)):l===0?o&&(e.result+=" "):e.result+=Ht.repeat(`
|
|
412
|
-
`,l):e.result+=Ht.repeat(`
|
|
413
|
-
`,o?1+l:l),o=!0,s=!0,l=0,n=e.position;!qi(f)&&f!==0;)f=e.input.charCodeAt(++e.position);ks(e,n,e.position,!1)}return!0}function CN(e,t){var n,r=e.tag,i=e.anchor,o=[],s,a=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,ce(e,"tab characters must not be used in indentation")),!(l!==45||(s=e.input.charCodeAt(e.position+1),!Kn(s))));){if(a=!0,e.position++,Dt(e,!0,-1)&&e.lineIndent<=t){o.push(null),l=e.input.charCodeAt(e.position);continue}if(n=e.line,pc(e,t,F8,!1,!0),o.push(e.result),Dt(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&l!==0)ce(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=o,!0):!1}function V2e(e,t,n){var r,i,o,s,a,l,u=e.tag,c=e.anchor,f={},h=Object.create(null),d=null,p=null,m=null,v=!1,b=!1,y;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=f),y=e.input.charCodeAt(e.position);y!==0;){if(!v&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,ce(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),o=e.line,(y===63||y===58)&&Kn(r))y===63?(v&&(su(e,f,h,d,p,null,s,a,l),d=p=m=null),b=!0,v=!0,i=!0):v?(v=!1,i=!0):ce(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,y=r;else{if(s=e.line,a=e.lineStart,l=e.position,!pc(e,n,B8,!1,!0))break;if(e.line===o){for(y=e.input.charCodeAt(e.position);Ba(y);)y=e.input.charCodeAt(++e.position);if(y===58)y=e.input.charCodeAt(++e.position),Kn(y)||ce(e,"a whitespace character is expected after the key-value separator within a block mapping"),v&&(su(e,f,h,d,p,null,s,a,l),d=p=m=null),b=!0,v=!1,i=!1,d=e.tag,p=e.result;else if(b)ce(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=u,e.anchor=c,!0}else if(b)ce(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=u,e.anchor=c,!0}if((e.line===o||e.lineIndent>t)&&(v&&(s=e.line,a=e.lineStart,l=e.position),pc(e,t,Zy,!0,i)&&(v?p=e.result:m=e.result),v||(su(e,f,h,d,p,m,s,a,l),d=p=m=null),Dt(e,!0,-1),y=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&y!==0)ce(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return v&&su(e,f,h,d,p,null,s,a,l),b&&(e.tag=u,e.anchor=c,e.kind="mapping",e.result=f),b}function q2e(e){var t,n=!1,r=!1,i,o,s;if(s=e.input.charCodeAt(e.position),s!==33)return!1;if(e.tag!==null&&ce(e,"duplication of a tag property"),s=e.input.charCodeAt(++e.position),s===60?(n=!0,s=e.input.charCodeAt(++e.position)):s===33?(r=!0,i="!!",s=e.input.charCodeAt(++e.position)):i="!",t=e.position,n){do s=e.input.charCodeAt(++e.position);while(s!==0&&s!==62);e.position<e.length?(o=e.input.slice(t,e.position),s=e.input.charCodeAt(++e.position)):ce(e,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!Kn(s);)s===33&&(r?ce(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),z8.test(i)||ce(e,"named tag handle cannot contain such characters"),r=!0,t=e.position+1)),s=e.input.charCodeAt(++e.position);o=e.input.slice(t,e.position),N2e.test(o)&&ce(e,"tag suffix cannot contain flow indicator characters")}o&&!W8.test(o)&&ce(e,"tag name cannot contain such characters: "+o);try{o=decodeURIComponent(o)}catch{ce(e,"tag name is malformed: "+o)}return n?e.tag=o:_s.call(e.tagMap,i)?e.tag=e.tagMap[i]+o:i==="!"?e.tag="!"+o:i==="!!"?e.tag="tag:yaml.org,2002:"+o:ce(e,'undeclared tag handle "'+i+'"'),!0}function K2e(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&ce(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!Kn(n)&&!ou(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&ce(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function G2e(e){var t,n,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Kn(r)&&!ou(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&ce(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),_s.call(e.anchorMap,n)||ce(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],Dt(e,!0,-1),!0}function pc(e,t,n,r,i){var o,s,a,l=1,u=!1,c=!1,f,h,d,p,m,v;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=s=a=Zy===n||F8===n,r&&Dt(e,!0,-1)&&(u=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;q2e(e)||K2e(e);)Dt(e,!0,-1)?(u=!0,a=o,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):a=!1;if(a&&(a=u||i),(l===1||Zy===n)&&(Yy===n||B8===n?m=t:m=t+1,v=e.position-e.lineStart,l===1?a&&(CN(e,v)||V2e(e,v,m))||U2e(e,m)?c=!0:(s&&H2e(e,m)||z2e(e,m)||W2e(e,m)?c=!0:G2e(e)?(c=!0,(e.tag!==null||e.anchor!==null)&&ce(e,"alias node should not have any properties")):F2e(e,m,Yy===n)&&(c=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(c=a&&CN(e,v))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&ce(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),f=0,h=e.implicitTypes.length;f<h;f+=1)if(p=e.implicitTypes[f],p.resolve(e.result)){e.result=p.construct(e.result),e.tag=p.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(_s.call(e.typeMap[e.kind||"fallback"],e.tag))p=e.typeMap[e.kind||"fallback"][e.tag];else for(p=null,d=e.typeMap.multi[e.kind||"fallback"],f=0,h=d.length;f<h;f+=1)if(e.tag.slice(0,d[f].tag.length)===d[f].tag){p=d[f];break}p||ce(e,"unknown tag !<"+e.tag+">"),e.result!==null&&p.kind!==e.kind&&ce(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+p.kind+'", not "'+e.kind+'"'),p.resolve(e.result,e.tag)?(e.result=p.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):ce(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||c}function Q2e(e){var t=e.position,n,r,i,o=!1,s;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(s=e.input.charCodeAt(e.position))!==0&&(Dt(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||s!==37));){for(o=!0,s=e.input.charCodeAt(++e.position),n=e.position;s!==0&&!Kn(s);)s=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&ce(e,"directive name must not be less than one character in length");s!==0;){for(;Ba(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!qi(s));break}if(qi(s))break;for(n=e.position;s!==0&&!Kn(s);)s=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}s!==0&&OP(e),_s.call(kN,r)?kN[r](e,r,i):Jy(e,'unknown document directive "'+r+'"')}if(Dt(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,Dt(e,!0,-1)):o&&ce(e,"directives end mark is expected"),pc(e,e.lineIndent-1,Zy,!1,!0),Dt(e,!0,-1),e.checkLineBreaks&&I2e.test(e.input.slice(t,e.position))&&Jy(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&ib(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,Dt(e,!0,-1));return}if(e.position<e.length-1)ce(e,"end of the stream or a document separator is expected");else return}function K8(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
414
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new B2e(e,t),r=e.indexOf("\0");for(r!==-1&&(n.position=r,ce(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Q2e(n);return n.documents}function X2e(e,t,n){t!==null&&typeof t=="object"&&typeof n>"u"&&(n=t,t=null);var r=K8(e,n);if(typeof t!="function")return r;for(var i=0,o=r.length;i<o;i+=1)t(r[i])}function Y2e(e,t){var n=K8(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new _n("expected a single document in the stream, but found more")}}var Z2e=X2e,J2e=Y2e,G8={loadAll:Z2e,load:J2e},Q8=Object.prototype.toString,X8=Object.prototype.hasOwnProperty,AP=65279,e_e=9,Cd=10,t_e=13,n_e=32,r_e=33,i_e=34,Lk=35,o_e=37,s_e=38,a_e=39,l_e=42,Y8=44,u_e=45,ev=58,c_e=61,f_e=62,h_e=63,d_e=64,Z8=91,J8=93,p_e=96,e6=123,m_e=124,t6=125,Sn={};Sn[0]="\\0";Sn[7]="\\a";Sn[8]="\\b";Sn[9]="\\t";Sn[10]="\\n";Sn[11]="\\v";Sn[12]="\\f";Sn[13]="\\r";Sn[27]="\\e";Sn[34]='\\"';Sn[92]="\\\\";Sn[133]="\\N";Sn[160]="\\_";Sn[8232]="\\L";Sn[8233]="\\P";var g_e=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],y_e=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function v_e(e,t){var n,r,i,o,s,a,l;if(t===null)return{};for(n={},r=Object.keys(t),i=0,o=r.length;i<o;i+=1)s=r[i],a=String(t[s]),s.slice(0,2)==="!!"&&(s="tag:yaml.org,2002:"+s.slice(2)),l=e.compiledTypeMap.fallback[s],l&&X8.call(l.styleAliases,a)&&(a=l.styleAliases[a]),n[s]=a;return n}function b_e(e){var t,n,r;if(t=e.toString(16).toUpperCase(),e<=255)n="x",r=2;else if(e<=65535)n="u",r=4;else if(e<=4294967295)n="U",r=8;else throw new _n("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+Ht.repeat("0",r-t.length)+t}var x_e=1,Ad=2;function w_e(e){this.schema=e.schema||kP,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Ht.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=v_e(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Ad:x_e,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function AN(e,t){for(var n=Ht.repeat(" ",t),r=0,i=-1,o="",s,a=e.length;r<a;)i=e.indexOf(`
|
|
415
|
-
`,r),i===-1?(s=e.slice(r),r=a):(s=e.slice(r,i+1),r=i+1),s.length&&s!==`
|
|
416
|
-
`&&(o+=n),o+=s;return o}function $k(e,t){return`
|
|
417
|
-
`+Ht.repeat(" ",e.indent*t)}function S_e(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}function tv(e){return e===n_e||e===e_e}function Pd(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==AP||65536<=e&&e<=1114111}function PN(e){return Pd(e)&&e!==AP&&e!==t_e&&e!==Cd}function EN(e,t,n){var r=PN(e),i=r&&!tv(e);return(n?r:r&&e!==Y8&&e!==Z8&&e!==J8&&e!==e6&&e!==t6)&&e!==Lk&&!(t===ev&&!i)||PN(t)&&!tv(t)&&e===Lk||t===ev&&i}function k_e(e){return Pd(e)&&e!==AP&&!tv(e)&&e!==u_e&&e!==h_e&&e!==ev&&e!==Y8&&e!==Z8&&e!==J8&&e!==e6&&e!==t6&&e!==Lk&&e!==s_e&&e!==l_e&&e!==r_e&&e!==m_e&&e!==c_e&&e!==f_e&&e!==a_e&&e!==i_e&&e!==o_e&&e!==d_e&&e!==p_e}function O_e(e){return!tv(e)&&e!==ev}function Lf(e,t){var n=e.charCodeAt(t),r;return n>=55296&&n<=56319&&t+1<e.length&&(r=e.charCodeAt(t+1),r>=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}function n6(e){var t=/^\n* /;return t.test(e)}var r6=1,Bk=2,i6=3,o6=4,Ll=5;function C_e(e,t,n,r,i,o,s,a){var l,u=0,c=null,f=!1,h=!1,d=r!==-1,p=-1,m=k_e(Lf(e,0))&&O_e(Lf(e,e.length-1));if(t||s)for(l=0;l<e.length;u>=65536?l+=2:l++){if(u=Lf(e,l),!Pd(u))return Ll;m=m&&EN(u,c,a),c=u}else{for(l=0;l<e.length;u>=65536?l+=2:l++){if(u=Lf(e,l),u===Cd)f=!0,d&&(h=h||l-p-1>r&&e[p+1]!==" ",p=l);else if(!Pd(u))return Ll;m=m&&EN(u,c,a),c=u}h=h||d&&l-p-1>r&&e[p+1]!==" "}return!f&&!h?m&&!s&&!i(e)?r6:o===Ad?Ll:Bk:n>9&&n6(e)?Ll:s?o===Ad?Ll:Bk:h?o6:i6}function A_e(e,t,n,r,i){e.dump=function(){if(t.length===0)return e.quotingType===Ad?'""':"''";if(!e.noCompatMode&&(g_e.indexOf(t)!==-1||y_e.test(t)))return e.quotingType===Ad?'"'+t+'"':"'"+t+"'";var o=e.indent*Math.max(1,n),s=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),a=r||e.flowLevel>-1&&n>=e.flowLevel;function l(u){return S_e(e,u)}switch(C_e(t,a,e.indent,s,l,e.quotingType,e.forceQuotes&&!r,i)){case r6:return t;case Bk:return"'"+t.replace(/'/g,"''")+"'";case i6:return"|"+TN(t,e.indent)+_N(AN(t,o));case o6:return">"+TN(t,e.indent)+_N(AN(P_e(t,s),o));case Ll:return'"'+E_e(t)+'"';default:throw new _n("impossible error: invalid scalar style")}}()}function TN(e,t){var n=n6(e)?String(t):"",r=e[e.length-1]===`
|
|
418
|
-
`,i=r&&(e[e.length-2]===`
|
|
419
|
-
`||e===`
|
|
420
|
-
`),o=i?"+":r?"":"-";return n+o+`
|
|
421
|
-
`}function _N(e){return e[e.length-1]===`
|
|
422
|
-
`?e.slice(0,-1):e}function P_e(e,t){for(var n=/(\n+)([^\n]*)/g,r=function(){var u=e.indexOf(`
|
|
423
|
-
`);return u=u!==-1?u:e.length,n.lastIndex=u,jN(e.slice(0,u),t)}(),i=e[0]===`
|
|
424
|
-
`||e[0]===" ",o,s;s=n.exec(e);){var a=s[1],l=s[2];o=l[0]===" ",r+=a+(!i&&!o&&l!==""?`
|
|
425
|
-
`:"")+jN(l,t),i=o}return r}function jN(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,r,i=0,o,s=0,a=0,l="";r=n.exec(e);)a=r.index,a-i>t&&(o=s>i?s:a,l+=`
|
|
426
|
-
`+e.slice(i,o),i=o+1),s=a;return l+=`
|
|
427
|
-
`,e.length-i>t&&s>i?l+=e.slice(i,s)+`
|
|
428
|
-
`+e.slice(s+1):l+=e.slice(i),l.slice(1)}function E_e(e){for(var t="",n=0,r,i=0;i<e.length;n>=65536?i+=2:i++)n=Lf(e,i),r=Sn[n],!r&&Pd(n)?(t+=e[i],n>=65536&&(t+=e[i+1])):t+=r||b_e(n);return t}function T_e(e,t,n){var r="",i=e.tag,o,s,a;for(o=0,s=n.length;o<s;o+=1)a=n[o],e.replacer&&(a=e.replacer.call(n,String(o),a)),(Mo(e,t,a,!1,!1)||typeof a>"u"&&Mo(e,t,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=i,e.dump="["+r+"]"}function MN(e,t,n,r){var i="",o=e.tag,s,a,l;for(s=0,a=n.length;s<a;s+=1)l=n[s],e.replacer&&(l=e.replacer.call(n,String(s),l)),(Mo(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&Mo(e,t+1,null,!0,!0,!1,!0))&&((!r||i!=="")&&(i+=$k(e,t)),e.dump&&Cd===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=o,e.dump=i||"[]"}function __e(e,t,n){var r="",i=e.tag,o=Object.keys(n),s,a,l,u,c;for(s=0,a=o.length;s<a;s+=1)c="",r!==""&&(c+=", "),e.condenseFlow&&(c+='"'),l=o[s],u=n[l],e.replacer&&(u=e.replacer.call(n,l,u)),Mo(e,t,l,!1,!1)&&(e.dump.length>1024&&(c+="? "),c+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Mo(e,t,u,!1,!1)&&(c+=e.dump,r+=c));e.tag=i,e.dump="{"+r+"}"}function j_e(e,t,n,r){var i="",o=e.tag,s=Object.keys(n),a,l,u,c,f,h;if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys=="function")s.sort(e.sortKeys);else if(e.sortKeys)throw new _n("sortKeys must be a boolean or a function");for(a=0,l=s.length;a<l;a+=1)h="",(!r||i!=="")&&(h+=$k(e,t)),u=s[a],c=n[u],e.replacer&&(c=e.replacer.call(n,u,c)),Mo(e,t+1,u,!0,!0,!0)&&(f=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,f&&(e.dump&&Cd===e.dump.charCodeAt(0)?h+="?":h+="? "),h+=e.dump,f&&(h+=$k(e,t)),Mo(e,t+1,c,!0,f)&&(e.dump&&Cd===e.dump.charCodeAt(0)?h+=":":h+=": ",h+=e.dump,i+=h));e.tag=o,e.dump=i||"{}"}function IN(e,t,n){var r,i,o,s,a,l;for(i=n?e.explicitTypes:e.implicitTypes,o=0,s=i.length;o<s;o+=1)if(a=i[o],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof t=="object"&&t instanceof a.instanceOf)&&(!a.predicate||a.predicate(t))){if(n?a.multi&&a.representName?e.tag=a.representName(t):e.tag=a.tag:e.tag="?",a.represent){if(l=e.styleMap[a.tag]||a.defaultStyle,Q8.call(a.represent)==="[object Function]")r=a.represent(t,l);else if(X8.call(a.represent,l))r=a.represent[l](t,l);else throw new _n("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');e.dump=r}return!0}return!1}function Mo(e,t,n,r,i,o,s){e.tag=null,e.dump=n,IN(e,n,!1)||IN(e,n,!0);var a=Q8.call(e.dump),l=r,u;r&&(r=e.flowLevel<0||e.flowLevel>t);var c=a==="[object Object]"||a==="[object Array]",f,h;if(c&&(f=e.duplicates.indexOf(n),h=f!==-1),(e.tag!==null&&e.tag!=="?"||h||e.indent!==2&&t>0)&&(i=!1),h&&e.usedDuplicates[f])e.dump="*ref_"+f;else{if(c&&h&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),a==="[object Object]")r&&Object.keys(e.dump).length!==0?(j_e(e,t,e.dump,i),h&&(e.dump="&ref_"+f+e.dump)):(__e(e,t,e.dump),h&&(e.dump="&ref_"+f+" "+e.dump));else if(a==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!s&&t>0?MN(e,t-1,e.dump,i):MN(e,t,e.dump,i),h&&(e.dump="&ref_"+f+e.dump)):(T_e(e,t,e.dump),h&&(e.dump="&ref_"+f+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&A_e(e,e.dump,t,o,l);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new _n("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(u=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",e.dump=u+" "+e.dump)}return!0}function M_e(e,t){var n=[],r=[],i,o;for(Fk(e,n,r),i=0,o=r.length;i<o;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=new Array(o)}function Fk(e,t,n){var r,i,o;if(e!==null&&typeof e=="object")if(i=t.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,o=e.length;i<o;i+=1)Fk(e[i],t,n);else for(r=Object.keys(e),i=0,o=r.length;i<o;i+=1)Fk(e[r[i]],t,n)}function I_e(e,t){t=t||{};var n=new w_e(t);n.noRefs||M_e(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),Mo(n,0,r,!0,!0)?n.dump+`
|
|
429
|
-
`:""}var N_e=I_e,R_e={dump:N_e};function PP(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var D_e=cn,L_e=x8,$_e=O8,B_e=T8,F_e=_8,z_e=kP,W_e=G8.load,U_e=G8.loadAll,H_e=R_e.dump,V_e=_n,q_e={binary:R8,float:E8,map:k8,null:C8,pairs:L8,set:$8,timestamp:I8,bool:A8,int:P8,merge:N8,omap:D8,seq:S8,str:w8},K_e=PP("safeLoad","load"),G_e=PP("safeLoadAll","loadAll"),Q_e=PP("safeDump","dump"),X_e={Type:D_e,Schema:L_e,FAILSAFE_SCHEMA:$_e,JSON_SCHEMA:B_e,CORE_SCHEMA:F_e,DEFAULT_SCHEMA:z_e,load:W_e,loadAll:U_e,dump:H_e,YAMLException:V_e,types:q_e,safeLoad:K_e,safeLoadAll:G_e,safeDump:Q_e};let zk=[],s6=[];(()=>{let e="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?s6:zk).push(n=n+e[t])})();function Y_e(e){if(e<768)return!1;for(let t=0,n=zk.length;;){let r=t+n>>1;if(e<zk[r])n=r;else if(e>=s6[r])t=r+1;else return!0;if(t==n)return!1}}function NN(e){return e>=127462&&e<=127487}const RN=8205;function Z_e(e,t,n=!0,r=!0){return(n?a6:J_e)(e,t,r)}function a6(e,t,n){if(t==e.length)return t;t&&l6(e.charCodeAt(t))&&u6(e.charCodeAt(t-1))&&t--;let r=i1(e,t);for(t+=DN(r);t<e.length;){let i=i1(e,t);if(r==RN||i==RN||n&&Y_e(i))t+=DN(i),r=i;else if(NN(i)){let o=0,s=t-2;for(;s>=0&&NN(i1(e,s));)o++,s-=2;if(o%2==0)break;t+=2}else break}return t}function J_e(e,t,n){for(;t>0;){let r=a6(e,t-2,n);if(r<t)return r;t--}return 0}function i1(e,t){let n=e.charCodeAt(t);if(!u6(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return l6(r)?(n-55296<<10)+(r-56320)+65536:n}function l6(e){return e>=56320&&e<57344}function u6(e){return e>=55296&&e<56320}function DN(e){return e<65536?1:2}class Re{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,n,r){[t,n]=mc(this,t,n);let i=[];return this.decompose(0,t,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),Ii.from(i,this.length-(n-t)+r.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,n=this.length){[t,n]=mc(this,t,n);let r=[];return this.decompose(t,n,r,0),Ii.from(r,n-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let n=this.scanIdentical(t,1),r=this.length-this.scanIdentical(t,-1),i=new ah(this),o=new ah(t);for(let s=n,a=n;;){if(i.next(s),o.next(s),s=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(a+=i.value.length,i.done||a>=r)return!0}}iter(t=1){return new ah(this,t)}iterRange(t,n=this.length){return new c6(this,t,n)}iterLines(t,n){let r;if(t==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(t).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new f6(r)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?Re.empty:t.length<=32?new Tt(t):Ii.from(Tt.split(t,[]))}}class Tt extends Re{constructor(t,n=eje(t)){super(),this.text=t,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(t,n,r,i){for(let o=0;;o++){let s=this.text[o],a=i+s.length;if((n?r:a)>=t)return new tje(i,a,r,s);i=a+1,r++}}decompose(t,n,r,i){let o=t<=0&&n>=this.length?this:new Tt(LN(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let s=r.pop(),a=eg(o.text,s.text.slice(),0,o.length);if(a.length<=32)r.push(new Tt(a,s.length+o.length));else{let l=a.length>>1;r.push(new Tt(a.slice(0,l)),new Tt(a.slice(l)))}}else r.push(o)}replace(t,n,r){if(!(r instanceof Tt))return super.replace(t,n,r);[t,n]=mc(this,t,n);let i=eg(this.text,eg(r.text,LN(this.text,0,t)),n),o=this.length+r.length-(n-t);return i.length<=32?new Tt(i,o):Ii.from(Tt.split(i,[]),o)}sliceString(t,n=this.length,r=`
|
|
430
|
-
`){[t,n]=mc(this,t,n);let i="";for(let o=0,s=0;o<=n&&s<this.text.length;s++){let a=this.text[s],l=o+a.length;o>t&&s&&(i+=r),t<l&&n>o&&(i+=a.slice(Math.max(0,t-o),n-o)),o=l+1}return i}flatten(t){for(let n of this.text)t.push(n)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let o of t)r.push(o),i+=o.length+1,r.length==32&&(n.push(new Tt(r,i)),r=[],i=-1);return i>-1&&n.push(new Tt(r,i)),n}}class Ii extends Re{constructor(t,n){super(),this.children=t,this.length=n,this.lines=0;for(let r of t)this.lines+=r.lines}lineInner(t,n,r,i){for(let o=0;;o++){let s=this.children[o],a=i+s.length,l=r+s.lines-1;if((n?l:a)>=t)return s.lineInner(t,n,r,i);i=a+1,r=l+1}}decompose(t,n,r,i){for(let o=0,s=0;s<=n&&o<this.children.length;o++){let a=this.children[o],l=s+a.length;if(t<=l&&n>=s){let u=i&((s<=t?1:0)|(l>=n?2:0));s>=t&&l<=n&&!u?r.push(a):a.decompose(t-s,n-s,r,u)}s=l+1}}replace(t,n,r){if([t,n]=mc(this,t,n),r.lines<this.lines)for(let i=0,o=0;i<this.children.length;i++){let s=this.children[i],a=o+s.length;if(t>=o&&n<=a){let l=s.replace(t-o,n-o,r),u=this.lines-s.lines+l.lines;if(l.lines<u>>4&&l.lines>u>>6){let c=this.children.slice();return c[i]=l,new Ii(c,this.length-(n-t)+r.length)}return super.replace(o,a,l)}o=a+1}return super.replace(t,n,r)}sliceString(t,n=this.length,r=`
|
|
431
|
-
`){[t,n]=mc(this,t,n);let i="";for(let o=0,s=0;o<this.children.length&&s<=n;o++){let a=this.children[o],l=s+a.length;s>t&&o&&(i+=r),t<l&&n>s&&(i+=a.sliceString(t-s,n-s,r)),s=l+1}return i}flatten(t){for(let n of this.children)n.flatten(t)}scanIdentical(t,n){if(!(t instanceof Ii))return 0;let r=0,[i,o,s,a]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,o+=n){if(i==s||o==a)return r;let l=this.children[i],u=t.children[o];if(l!=u)return r+l.scanIdentical(u,n);r+=l.length+1}}static from(t,n=t.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let d of t)r+=d.lines;if(r<32){let d=[];for(let p of t)p.flatten(d);return new Tt(d,n)}let i=Math.max(32,r>>5),o=i<<1,s=i>>1,a=[],l=0,u=-1,c=[];function f(d){let p;if(d.lines>o&&d instanceof Ii)for(let m of d.children)f(m);else d.lines>s&&(l>s||!l)?(h(),a.push(d)):d instanceof Tt&&l&&(p=c[c.length-1])instanceof Tt&&d.lines+p.lines<=32?(l+=d.lines,u+=d.length+1,c[c.length-1]=new Tt(p.text.concat(d.text),p.length+1+d.length)):(l+d.lines>i&&h(),l+=d.lines,u+=d.length+1,c.push(d))}function h(){l!=0&&(a.push(c.length==1?c[0]:Ii.from(c,u)),u=-1,l=c.length=0)}for(let d of t)f(d);return h(),a.length==1?a[0]:new Ii(a,n)}}Re.empty=new Tt([""],0);function eje(e){let t=-1;for(let n of e)t+=n.length+1;return t}function eg(e,t,n=0,r=1e9){for(let i=0,o=0,s=!0;o<e.length&&i<=r;o++){let a=e[o],l=i+a.length;l>=n&&(l>r&&(a=a.slice(0,r-i)),i<n&&(a=a.slice(n-i)),s?(t[t.length-1]+=a,s=!1):t.push(a)),i=l+1}return t}function LN(e,t,n){return eg(e,[""],t,n)}class ah{constructor(t,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[n>0?1:(t instanceof Tt?t.text.length:t.children.length)<<1]}nextInner(t,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],o=this.offsets[r],s=o>>1,a=i instanceof Tt?i.text.length:i.children.length;if(s==(n>0?a:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((o&1)==(n>0?0:1)){if(this.offsets[r]+=n,t==0)return this.lineBreak=!0,this.value=`
|
|
432
|
-
`,this;t--}else if(i instanceof Tt){let l=i.text[s+(n<0?-1:0)];if(this.offsets[r]+=n,l.length>Math.max(0,t))return this.value=t==0?l:n>0?l.slice(t):l.slice(0,l.length-t),this;t-=l.length}else{let l=i.children[s+(n<0?-1:0)];t>l.length?(t-=l.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof Tt?l.text.length:l.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class c6{constructor(t,n,r){this.value="",this.done=!1,this.cursor=new ah(t,n>r?-1:1),this.pos=n>r?t.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(t,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;t>r&&(t=r),r-=t;let{value:i}=this.cursor.next(t);return this.pos+=(i.length+t)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class f6{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:n,lineBreak:r,value:i}=this.inner.next(t);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Re.prototype[Symbol.iterator]=function(){return this.iter()},ah.prototype[Symbol.iterator]=c6.prototype[Symbol.iterator]=f6.prototype[Symbol.iterator]=function(){return this});class tje{constructor(t,n,r,i){this.from=t,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}}function mc(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function Jt(e,t,n=!0,r=!0){return Z_e(e,t,n,r)}function nje(e){return e>=56320&&e<57344}function rje(e){return e>=55296&&e<56320}function zn(e,t){let n=e.charCodeAt(t);if(!rje(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return nje(r)?(n-55296<<10)+(r-56320)+65536:n}function EP(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function Ni(e){return e<65536?1:2}const Wk=/\r\n?|\n/;var jn=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(jn||(jn={}));class Ki{constructor(t){this.sections=t}get length(){let t=0;for(let n=0;n<this.sections.length;n+=2)t+=this.sections[n];return t}get newLength(){let t=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];t+=r<0?this.sections[n]:r}return t}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(t){for(let n=0,r=0,i=0;n<this.sections.length;){let o=this.sections[n++],s=this.sections[n++];s<0?(t(r,i,o),i+=o):i+=s,r+=o}}iterChangedRanges(t,n=!1){Uk(this,t,n)}get invertedDesc(){let t=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];i<0?t.push(r,i):t.push(i,r)}return new Ki(t)}composeDesc(t){return this.empty?t:t.empty?this:h6(this,t)}mapDesc(t,n=!1){return t.empty?this:Hk(this,t,n)}mapPos(t,n=-1,r=jn.Simple){let i=0,o=0;for(let s=0;s<this.sections.length;){let a=this.sections[s++],l=this.sections[s++],u=i+a;if(l<0){if(u>t)return o+(t-i);o+=a}else{if(r!=jn.Simple&&u>=t&&(r==jn.TrackDel&&i<t&&u>t||r==jn.TrackBefore&&i<t||r==jn.TrackAfter&&u>t))return null;if(u>t||u==t&&n<0&&!a)return t==i||n<0?o:o+l;o+=l}i=u}if(t>i)throw new RangeError(`Position ${t} is out of range for changeset of length ${i}`);return o}touchesRange(t,n=t){for(let r=0,i=0;r<this.sections.length&&i<=n;){let o=this.sections[r++],s=this.sections[r++],a=i+o;if(s>=0&&i<=n&&a>=t)return i<t&&a>n?"cover":!0;i=a}return!1}toString(){let t="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];t+=(t?" ":"")+r+(i>=0?":"+i:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Ki(t)}static create(t){return new Ki(t)}}class zt extends Ki{constructor(t,n){super(t),this.inserted=n}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return Uk(this,(n,r,i,o,s)=>t=t.replace(i,i+(r-n),s),!1),t}mapDesc(t,n=!1){return Hk(this,t,n,!0)}invert(t){let n=this.sections.slice(),r=[];for(let i=0,o=0;i<n.length;i+=2){let s=n[i],a=n[i+1];if(a>=0){n[i]=a,n[i+1]=s;let l=i>>1;for(;r.length<l;)r.push(Re.empty);r.push(s?t.slice(o,o+s):Re.empty)}o+=s}return new zt(n,r)}compose(t){return this.empty?t:t.empty?this:h6(this,t,!0)}map(t,n=!1){return t.empty?this:Hk(this,t,n,!0)}iterChanges(t,n=!1){Uk(this,t,n)}get desc(){return Ki.create(this.sections)}filter(t){let n=[],r=[],i=[],o=new Ed(this);e:for(let s=0,a=0;;){let l=s==t.length?1e9:t[s++];for(;a<l||a==l&&o.len==0;){if(o.done)break e;let c=Math.min(o.len,l-a);gn(i,c,-1);let f=o.ins==-1?-1:o.off==0?o.ins:0;gn(n,c,f),f>0&&us(r,n,o.text),o.forward(c),a+=c}let u=t[s++];for(;a<u;){if(o.done)break e;let c=Math.min(o.len,u-a);gn(n,c,-1),gn(i,c,o.ins==-1?-1:o.off==0?o.ins:0),o.forward(c),a+=c}}return{changes:new zt(n,r),filtered:Ki.create(i)}}toJSON(){let t=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],i=this.sections[n+1];i<0?t.push(r):i==0?t.push([r]):t.push([r].concat(this.inserted[n>>1].toJSON()))}return t}static of(t,n,r){let i=[],o=[],s=0,a=null;function l(c=!1){if(!c&&!i.length)return;s<n&&gn(i,n-s,-1);let f=new zt(i,o);a=a?a.compose(f.map(a)):f,i=[],o=[],s=0}function u(c){if(Array.isArray(c))for(let f of c)u(f);else if(c instanceof zt){if(c.length!=n)throw new RangeError(`Mismatched change set length (got ${c.length}, expected ${n})`);l(),a=a?a.compose(c.map(a)):c}else{let{from:f,to:h=f,insert:d}=c;if(f>h||f<0||h>n)throw new RangeError(`Invalid change range ${f} to ${h} (in doc of length ${n})`);let p=d?typeof d=="string"?Re.of(d.split(r||Wk)):d:Re.empty,m=p.length;if(f==h&&m==0)return;f<s&&l(),f>s&&gn(i,f-s,-1),gn(i,h-f,m),us(o,i,p),s=h}}return u(t),l(!a),a}static empty(t){return new zt(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;i<t.length;i++){let o=t[i];if(typeof o=="number")n.push(o,-1);else{if(!Array.isArray(o)||typeof o[0]!="number"||o.some((s,a)=>a&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)n.push(o[0],0);else{for(;r.length<i;)r.push(Re.empty);r[i]=Re.of(o.slice(1)),n.push(o[0],r[i].length)}}}return new zt(n,r)}static createSet(t,n){return new zt(t,n)}}function gn(e,t,n,r=!1){if(t==0&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function us(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(Re.empty);e.push(n)}}function Uk(e,t,n){let r=e.inserted;for(let i=0,o=0,s=0;s<e.sections.length;){let a=e.sections[s++],l=e.sections[s++];if(l<0)i+=a,o+=a;else{let u=i,c=o,f=Re.empty;for(;u+=a,c+=l,l&&r&&(f=f.append(r[s-2>>1])),!(n||s==e.sections.length||e.sections[s+1]<0);)a=e.sections[s++],l=e.sections[s++];t(i,u,o,c,f),i=u,o=c}}}function Hk(e,t,n,r=!1){let i=[],o=r?[]:null,s=new Ed(e),a=new Ed(t);for(let l=-1;;){if(s.done&&a.len||a.done&&s.len)throw new Error("Mismatched change set lengths");if(s.ins==-1&&a.ins==-1){let u=Math.min(s.len,a.len);gn(i,u,-1),s.forward(u),a.forward(u)}else if(a.ins>=0&&(s.ins<0||l==s.i||s.off==0&&(a.len<s.len||a.len==s.len&&!n))){let u=a.len;for(gn(i,a.ins,-1);u;){let c=Math.min(s.len,u);s.ins>=0&&l<s.i&&s.len<=c&&(gn(i,0,s.ins),o&&us(o,i,s.text),l=s.i),s.forward(c),u-=c}a.next()}else if(s.ins>=0){let u=0,c=s.len;for(;c;)if(a.ins==-1){let f=Math.min(c,a.len);u+=f,c-=f,a.forward(f)}else if(a.ins==0&&a.len<c)c-=a.len,a.next();else break;gn(i,u,l<s.i?s.ins:0),o&&l<s.i&&us(o,i,s.text),l=s.i,s.forward(s.len-c)}else{if(s.done&&a.done)return o?zt.createSet(i,o):Ki.create(i);throw new Error("Mismatched change set lengths")}}}function h6(e,t,n=!1){let r=[],i=n?[]:null,o=new Ed(e),s=new Ed(t);for(let a=!1;;){if(o.done&&s.done)return i?zt.createSet(r,i):Ki.create(r);if(o.ins==0)gn(r,o.len,0,a),o.next();else if(s.len==0&&!s.done)gn(r,0,s.ins,a),i&&us(i,r,s.text),s.next();else{if(o.done||s.done)throw new Error("Mismatched change set lengths");{let l=Math.min(o.len2,s.len),u=r.length;if(o.ins==-1){let c=s.ins==-1?-1:s.off?0:s.ins;gn(r,l,c,a),i&&c&&us(i,r,s.text)}else s.ins==-1?(gn(r,o.off?0:o.len,l,a),i&&us(i,r,o.textBit(l))):(gn(r,o.off?0:o.len,s.off?0:s.ins,a),i&&!s.off&&us(i,r,s.text));a=(o.ins>l||s.ins>=0&&s.len>l)&&(a||r.length>u),o.forward2(l),s.forward(l)}}}}class Ed{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i<t.length?(this.len=t[this.i++],this.ins=t[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length?Re.empty:t[n]}textBit(t){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!t?Re.empty:n[r].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class Aa{constructor(t,n,r){this.from=t,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let t=this.flags&7;return t==7?null:t}get goalColumn(){let t=this.flags>>6;return t==16777215?void 0:t}map(t,n=-1){let r,i;return this.empty?r=i=t.mapPos(this.from,n):(r=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new Aa(r,i,this.flags)}extend(t,n=t,r=0){if(t<=this.anchor&&n>=this.anchor)return V.range(t,n,void 0,void 0,r);let i=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return V.range(this.anchor,i,void 0,void 0,r)}eq(t,n=!1){return this.anchor==t.anchor&&this.head==t.head&&this.goalColumn==t.goalColumn&&(!n||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return V.range(t.anchor,t.head)}static create(t,n,r){return new Aa(t,n,r)}}class V{constructor(t,n){this.ranges=t,this.mainIndex=n}map(t,n=-1){return t.empty?this:V.create(this.ranges.map(r=>r.map(t,n)),this.mainIndex)}eq(t,n=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(t.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new V([this.main],0)}addRange(t,n=!0){return V.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let r=this.ranges.slice();return r[n]=t,V.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(t=>t.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new V(t.ranges.map(n=>Aa.fromJSON(n)),t.main)}static single(t,n=t){return new V([V.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<t.length;i++){let o=t[i];if(o.empty?o.from<=r:o.from<r)return V.normalized(t.slice(),n);r=o.to}return new V(t,n)}static cursor(t,n=0,r,i){return Aa.create(t,t,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r))|(i??16777215)<<6)}static range(t,n,r,i,o){let s=(r??16777215)<<6|(i==null?7:Math.min(6,i));return!o&&t!=n&&(o=n<t?1:-1),n<t?Aa.create(n,t,48|s):Aa.create(t,n,(o?o<0?8:16:0)|s)}static normalized(t,n=0){let r=t[n];t.sort((i,o)=>i.from-o.from),n=t.indexOf(r);for(let i=1;i<t.length;i++){let o=t[i],s=t[i-1];if(o.empty?o.from<=s.to:o.from<s.to){let a=s.from,l=Math.max(o.to,s.to);i<=n&&n--,t.splice(--i,2,o.anchor>o.head?V.range(l,a):V.range(a,l))}}return new V(t,n)}}function d6(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let TP=0;class se{constructor(t,n,r,i,o){this.combine=t,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=TP++,this.default=t([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(t={}){return new se(t.combine||(n=>n),t.compareInput||((n,r)=>n===r),t.compare||(t.combine?(n,r)=>n===r:_P),!!t.static,t.enables)}of(t){return new tg([],this,0,t)}compute(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new tg(t,this,1,n)}computeN(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new tg(t,this,2,n)}from(t,n){return n||(n=r=>r),this.compute([t],r=>n(r.field(t)))}}function _P(e,t){return e==t||e.length==t.length&&e.every((n,r)=>n===t[r])}class tg{constructor(t,n,r,i){this.dependencies=t,this.facet=n,this.type=r,this.value=i,this.id=TP++}dynamicSlot(t){var n;let r=this.value,i=this.facet.compareInput,o=this.id,s=t[o]>>1,a=this.type==2,l=!1,u=!1,c=[];for(let f of this.dependencies)f=="doc"?l=!0:f=="selection"?u=!0:((n=t[f.id])!==null&&n!==void 0?n:1)&1||c.push(t[f.id]);return{create(f){return f.values[s]=r(f),1},update(f,h){if(l&&h.docChanged||u&&(h.docChanged||h.selection)||Vk(f,c)){let d=r(f);if(a?!$N(d,f.values[s],i):!i(d,f.values[s]))return f.values[s]=d,1}return 0},reconfigure:(f,h)=>{let d,p=h.config.address[o];if(p!=null){let m=rv(h,p);if(this.dependencies.every(v=>v instanceof se?h.facet(v)===f.facet(v):v instanceof kn?h.field(v,!1)==f.field(v,!1):!0)||(a?$N(d=r(f),m,i):i(d=r(f),m)))return f.values[s]=m,0}else d=r(f);return f.values[s]=d,1}}}}function $N(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function Vk(e,t){let n=!1;for(let r of t)lh(e,r)&1&&(n=!0);return n}function ije(e,t,n){let r=n.map(l=>e[l.id]),i=n.map(l=>l.type),o=r.filter(l=>!(l&1)),s=e[t.id]>>1;function a(l){let u=[];for(let c=0;c<r.length;c++){let f=rv(l,r[c]);if(i[c]==2)for(let h of f)u.push(h);else u.push(f)}return t.combine(u)}return{create(l){for(let u of r)lh(l,u);return l.values[s]=a(l),1},update(l,u){if(!Vk(l,o))return 0;let c=a(l);return t.compare(c,l.values[s])?0:(l.values[s]=c,1)},reconfigure(l,u){let c=Vk(l,r),f=u.config.facets[t.id],h=u.facet(t);if(f&&!c&&_P(n,f))return l.values[s]=h,0;let d=a(l);return t.compare(d,h)?(l.values[s]=h,0):(l.values[s]=d,1)}}}const lm=se.define({static:!0});class kn{constructor(t,n,r,i,o){this.id=t,this.createF=n,this.updateF=r,this.compareF=i,this.spec=o,this.provides=void 0}static define(t){let n=new kn(TP++,t.create,t.update,t.compare||((r,i)=>r===i),t);return t.provide&&(n.provides=t.provide(n)),n}create(t){let n=t.facet(lm).find(r=>r.field==this);return(n?.create||this.createF)(t)}slot(t){let n=t[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let o=r.values[n],s=this.updateF(o,i);return this.compareF(o,s)?0:(r.values[n]=s,1)},reconfigure:(r,i)=>{let o=r.facet(lm),s=i.facet(lm),a;return(a=o.find(l=>l.field==this))&&a!=s.find(l=>l.field==this)?(r.values[n]=a.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(t){return[this,lm.of({field:this,create:t})]}get extension(){return this}}const pa={lowest:4,low:3,default:2,high:1,highest:0};function Cf(e){return t=>new p6(t,e)}const bl={highest:Cf(pa.highest),high:Cf(pa.high),default:Cf(pa.default),low:Cf(pa.low),lowest:Cf(pa.lowest)};class p6{constructor(t,n){this.inner=t,this.prec=n}}class ob{of(t){return new qk(this,t)}reconfigure(t){return ob.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class qk{constructor(t,n){this.compartment=t,this.inner=n}}class nv{constructor(t,n,r,i,o,s){for(this.base=t,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.facets=s,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(t){let n=this.address[t.id];return n==null?t.default:this.staticValues[n>>1]}static resolve(t,n,r){let i=[],o=Object.create(null),s=new Map;for(let h of oje(t,n,s))h instanceof kn?i.push(h):(o[h.facet.id]||(o[h.facet.id]=[])).push(h);let a=Object.create(null),l=[],u=[];for(let h of i)a[h.id]=u.length<<1,u.push(d=>h.slot(d));let c=r?.config.facets;for(let h in o){let d=o[h],p=d[0].facet,m=c&&c[h]||[];if(d.every(v=>v.type==0))if(a[p.id]=l.length<<1|1,_P(m,d))l.push(r.facet(p));else{let v=p.combine(d.map(b=>b.value));l.push(r&&p.compare(v,r.facet(p))?r.facet(p):v)}else{for(let v of d)v.type==0?(a[v.id]=l.length<<1|1,l.push(v.value)):(a[v.id]=u.length<<1,u.push(b=>v.dynamicSlot(b)));a[p.id]=u.length<<1,u.push(v=>ije(v,p,d))}}let f=u.map(h=>h(a));return new nv(t,s,f,a,l,o)}}function oje(e,t,n){let r=[[],[],[],[],[]],i=new Map;function o(s,a){let l=i.get(s);if(l!=null){if(l<=a)return;let u=r[l].indexOf(s);u>-1&&r[l].splice(u,1),s instanceof qk&&n.delete(s.compartment)}if(i.set(s,a),Array.isArray(s))for(let u of s)o(u,a);else if(s instanceof qk){if(n.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=t.get(s.compartment)||s.inner;n.set(s.compartment,u),o(u,a)}else if(s instanceof p6)o(s.inner,s.prec);else if(s instanceof kn)r[a].push(s),s.provides&&o(s.provides,a);else if(s instanceof tg)r[a].push(s),s.facet.extensions&&o(s.facet.extensions,pa.default);else{let u=s.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(u,a)}}return o(e,pa.default),r.reduce((s,a)=>s.concat(a))}function lh(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function rv(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}const m6=se.define(),Kk=se.define({combine:e=>e.some(t=>t),static:!0}),g6=se.define({combine:e=>e.length?e[0]:void 0,static:!0}),y6=se.define(),v6=se.define(),b6=se.define(),x6=se.define({combine:e=>e.length?e[0]:!1});class Zi{constructor(t,n){this.type=t,this.value=n}static define(){return new sje}}class sje{of(t){return new Zi(this,t)}}class aje{constructor(t){this.map=t}of(t){return new ke(this,t)}}class ke{constructor(t,n){this.type=t,this.value=n}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new ke(this.type,n)}is(t){return this.type==t}static define(t={}){return new aje(t.map||(n=>n))}static mapEffects(t,n){if(!t.length)return t;let r=[];for(let i of t){let o=i.map(n);o&&r.push(o)}return r}}ke.reconfigure=ke.define();ke.appendConfig=ke.define();class Kt{constructor(t,n,r,i,o,s){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=s,this._doc=null,this._state=null,r&&d6(r,n.newLength),o.some(a=>a.type==Kt.time)||(this.annotations=o.concat(Kt.time.of(Date.now())))}static create(t,n,r,i,o,s){return new Kt(t,n,r,i,o,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let n of this.annotations)if(n.type==t)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(Kt.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}Kt.time=Zi.define();Kt.userEvent=Zi.define();Kt.addToHistory=Zi.define();Kt.remote=Zi.define();function lje(e,t){let n=[];for(let r=0,i=0;;){let o,s;if(r<e.length&&(i==t.length||t[i]>=e[r]))o=e[r++],s=e[r++];else if(i<t.length)o=t[i++],s=t[i++];else return n;!n.length||n[n.length-1]<o?n.push(o,s):n[n.length-1]<s&&(n[n.length-1]=s)}}function w6(e,t,n){var r;let i,o,s;return n?(i=t.changes,o=zt.empty(t.changes.length),s=e.changes.compose(t.changes)):(i=t.changes.map(e.changes),o=e.changes.mapDesc(t.changes,!0),s=e.changes.compose(i)),{changes:s,selection:t.selection?t.selection.map(o):(r=e.selection)===null||r===void 0?void 0:r.map(i),effects:ke.mapEffects(e.effects,i).concat(ke.mapEffects(t.effects,o)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function Gk(e,t,n){let r=t.selection,i=Cu(t.annotations);return t.userEvent&&(i=i.concat(Kt.userEvent.of(t.userEvent))),{changes:t.changes instanceof zt?t.changes:zt.of(t.changes||[],n,e.facet(g6)),selection:r&&(r instanceof V?r:V.single(r.anchor,r.head)),effects:Cu(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function S6(e,t,n){let r=Gk(e,t.length?t[0]:{},e.doc.length);t.length&&t[0].filter===!1&&(n=!1);for(let o=1;o<t.length;o++){t[o].filter===!1&&(n=!1);let s=!!t[o].sequential;r=w6(r,Gk(e,t[o],s?r.changes.newLength:e.doc.length),s)}let i=Kt.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return cje(n?uje(i):i)}function uje(e){let t=e.startState,n=!0;for(let i of t.facet(y6)){let o=i(e);if(o===!1){n=!1;break}Array.isArray(o)&&(n=n===!0?o:lje(n,o))}if(n!==!0){let i,o;if(n===!1)o=e.changes.invertedDesc,i=zt.empty(t.doc.length);else{let s=e.changes.filter(n);i=s.changes,o=s.filtered.mapDesc(s.changes).invertedDesc}e=Kt.create(t,i,e.selection&&e.selection.map(o),ke.mapEffects(e.effects,o),e.annotations,e.scrollIntoView)}let r=t.facet(v6);for(let i=r.length-1;i>=0;i--){let o=r[i](e);o instanceof Kt?e=o:Array.isArray(o)&&o.length==1&&o[0]instanceof Kt?e=o[0]:e=S6(t,Cu(o),!1)}return e}function cje(e){let t=e.startState,n=t.facet(b6),r=e;for(let i=n.length-1;i>=0;i--){let o=n[i](e);o&&Object.keys(o).length&&(r=w6(r,Gk(t,o,e.changes.newLength),!0))}return r==e?e:Kt.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}const fje=[];function Cu(e){return e==null?fje:Array.isArray(e)?e:[e]}var yt=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(yt||(yt={}));const hje=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Qk;try{Qk=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function dje(e){if(Qk)return Qk.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||hje.test(n)))return!0}return!1}function pje(e){return t=>{if(!/\S/.test(t))return yt.Space;if(dje(t))return yt.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return yt.Word;return yt.Other}}class Ne{constructor(t,n,r,i,o,s){this.config=t,this.doc=n,this.selection=r,this.values=i,this.status=t.statusTemplate.slice(),this.computeSlot=o,s&&(s._state=this);for(let a=0;a<this.config.dynamicSlots.length;a++)lh(this,a<<1);this.computeSlot=null}field(t,n=!0){let r=this.config.address[t.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return lh(this,r),rv(this,r)}update(...t){return S6(this,t,!0)}applyTransaction(t){let n=this.config,{base:r,compartments:i}=n;for(let a of t.effects)a.is(ob.reconfigure)?(n&&(i=new Map,n.compartments.forEach((l,u)=>i.set(u,l)),n=null),i.set(a.value.compartment,a.value.extension)):a.is(ke.reconfigure)?(n=null,r=a.value):a.is(ke.appendConfig)&&(n=null,r=Cu(r).concat(a.value));let o;n?o=t.startState.values.slice():(n=nv.resolve(r,i,this),o=new Ne(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,u)=>u.reconfigure(l,this),null).values);let s=t.startState.facet(Kk)?t.newSelection:t.newSelection.asSingle();new Ne(n,t.newDoc,s,o,(a,l)=>l.update(a,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:t},range:V.cursor(n.from+t.length)}))}changeByRange(t){let n=this.selection,r=t(n.ranges[0]),i=this.changes(r.changes),o=[r.range],s=Cu(r.effects);for(let a=1;a<n.ranges.length;a++){let l=t(n.ranges[a]),u=this.changes(l.changes),c=u.map(i);for(let h=0;h<a;h++)o[h]=o[h].map(c);let f=i.mapDesc(u,!0);o.push(l.range.map(f)),i=i.compose(c),s=ke.mapEffects(s,c).concat(ke.mapEffects(Cu(l.effects),f))}return{changes:i,selection:V.create(o,n.mainIndex),effects:s}}changes(t=[]){return t instanceof zt?t:zt.of(t,this.doc.length,this.facet(Ne.lineSeparator))}toText(t){return Re.of(t.split(this.facet(Ne.lineSeparator)||Wk))}sliceDoc(t=0,n=this.doc.length){return this.doc.sliceString(t,n,this.lineBreak)}facet(t){let n=this.config.address[t.id];return n==null?t.default:(lh(this,n),rv(this,n))}toJSON(t){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(let r in t){let i=t[r];i instanceof kn&&this.config.address[i.id]!=null&&(n[r]=i.spec.toJSON(this.field(t[r]),this))}return n}static fromJSON(t,n={},r){if(!t||typeof t.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let o in r)if(Object.prototype.hasOwnProperty.call(t,o)){let s=r[o],a=t[o];i.push(s.init(l=>s.spec.fromJSON(a,l)))}}return Ne.create({doc:t.doc,selection:V.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=nv.resolve(t.extensions||[],new Map),r=t.doc instanceof Re?t.doc:Re.of((t.doc||"").split(n.staticFacet(Ne.lineSeparator)||Wk)),i=t.selection?t.selection instanceof V?t.selection:V.single(t.selection.anchor,t.selection.head):V.single(0);return d6(i,r.length),n.staticFacet(Kk)||(i=i.asSingle()),new Ne(n,r,i,n.dynamicSlots.map(()=>null),(o,s)=>s.create(o),null)}get tabSize(){return this.facet(Ne.tabSize)}get lineBreak(){return this.facet(Ne.lineSeparator)||`
|
|
433
|
-
`}get readOnly(){return this.facet(x6)}phrase(t,...n){for(let r of this.facet(Ne.phrases))if(Object.prototype.hasOwnProperty.call(r,t)){t=r[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let o=+(i||1);return!o||o>n.length?r:n[o-1]})),t}languageDataAt(t,n,r=-1){let i=[];for(let o of this.facet(m6))for(let s of o(this,n,r))Object.prototype.hasOwnProperty.call(s,t)&&i.push(s[t]);return i}charCategorizer(t){let n=this.languageDataAt("wordChars",t);return pje(n.length?n[0]:"")}wordAt(t){let{text:n,from:r,length:i}=this.doc.lineAt(t),o=this.charCategorizer(t),s=t-r,a=t-r;for(;s>0;){let l=Jt(n,s,!1);if(o(n.slice(l,s))!=yt.Word)break;s=l}for(;a<i;){let l=Jt(n,a);if(o(n.slice(a,l))!=yt.Word)break;a=l}return s==a?null:V.range(s+r,a+r)}}Ne.allowMultipleSelections=Kk;Ne.tabSize=se.define({combine:e=>e.length?e[0]:4});Ne.lineSeparator=g6;Ne.readOnly=x6;Ne.phrases=se.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(i=>e[i]==t[i])}});Ne.languageData=m6;Ne.changeFilter=y6;Ne.transactionFilter=v6;Ne.transactionExtender=b6;ob.reconfigure=ke.define();function Ji(e,t,n={}){let r={};for(let i of e)for(let o of Object.keys(i)){let s=i[o],a=r[o];if(a===void 0)r[o]=s;else if(!(a===s||s===void 0))if(Object.hasOwnProperty.call(n,o))r[o]=n[o](a,s);else throw new Error("Config merge conflict for field "+o)}for(let i in t)r[i]===void 0&&(r[i]=t[i]);return r}class js{eq(t){return this==t}range(t,n=t){return Xk.create(t,n,this)}}js.prototype.startSide=js.prototype.endSide=0;js.prototype.point=!1;js.prototype.mapMode=jn.TrackDel;function jP(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}let Xk=class k6{constructor(t,n,r){this.from=t,this.to=n,this.value=r}static create(t,n,r){return new k6(t,n,r)}};function Yk(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class MP{constructor(t,n,r,i){this.from=t,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(t,n,r,i=0){let o=r?this.to:this.from;for(let s=i,a=o.length;;){if(s==a)return s;let l=s+a>>1,u=o[l]-t||(r?this.value[l].endSide:this.value[l].startSide)-n;if(l==s)return u>=0?s:a;u>=0?a=l:s=l+1}}between(t,n,r,i){for(let o=this.findIndex(n,-1e9,!0),s=this.findIndex(r,1e9,!1,o);o<s;o++)if(i(this.from[o]+t,this.to[o]+t,this.value[o])===!1)return!1}map(t,n){let r=[],i=[],o=[],s=-1,a=-1;for(let l=0;l<this.value.length;l++){let u=this.value[l],c=this.from[l]+t,f=this.to[l]+t,h,d;if(c==f){let p=n.mapPos(c,u.startSide,u.mapMode);if(p==null||(h=d=p,u.startSide!=u.endSide&&(d=n.mapPos(c,u.endSide),d<h)))continue}else if(h=n.mapPos(c,u.startSide),d=n.mapPos(f,u.endSide),h>d||h==d&&u.startSide>0&&u.endSide<=0)continue;(d-h||u.endSide-u.startSide)<0||(s<0&&(s=h),u.point&&(a=Math.max(a,d-h)),r.push(u),i.push(h-s),o.push(d-s))}return{mapped:r.length?new MP(i,o,r,a):null,pos:s}}}class _e{constructor(t,n,r,i){this.chunkPos=t,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(t,n,r,i){return new _e(t,n,r,i)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let n of this.chunk)t+=n.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:o=this.length}=t,s=t.filter;if(n.length==0&&!s)return this;if(r&&(n=n.slice().sort(Yk)),this.isEmpty)return n.length?_e.of(n):this;let a=new O6(this,null,-1).goto(0),l=0,u=[],c=new Io;for(;a.value||l<n.length;)if(l<n.length&&(a.from-n[l].from||a.startSide-n[l].value.startSide)>=0){let f=n[l++];c.addInner(f.from,f.to,f.value)||u.push(f)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(l==n.length||this.chunkEnd(a.chunkIndex)<n[l].from)&&(!s||i>this.chunkEnd(a.chunkIndex)||o<this.chunkPos[a.chunkIndex])&&c.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!s||i>a.to||o<a.from||s(a.from,a.to,a.value))&&(c.addInner(a.from,a.to,a.value)||u.push(Xk.create(a.from,a.to,a.value))),a.next());return c.finishInner(this.nextLayer.isEmpty&&!u.length?_e.empty:this.nextLayer.update({add:u,filter:s,filterFrom:i,filterTo:o}))}map(t){if(t.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let s=0;s<this.chunk.length;s++){let a=this.chunkPos[s],l=this.chunk[s],u=t.touchesRange(a,a+l.length);if(u===!1)i=Math.max(i,l.maxPoint),n.push(l),r.push(t.mapPos(a));else if(u===!0){let{mapped:c,pos:f}=l.map(a,t);c&&(i=Math.max(i,c.maxPoint),n.push(c),r.push(f))}}let o=this.nextLayer.map(t);return n.length==0?o:new _e(r,n,o||_e.empty,i)}between(t,n,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let o=this.chunkPos[i],s=this.chunk[i];if(n>=o&&t<=o+s.length&&s.between(o,t-o,n-o,r)===!1)return}this.nextLayer.between(t,n,r)}}iter(t=0){return Td.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,n=0){return Td.from(t).goto(n)}static compare(t,n,r,i,o=-1){let s=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),a=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),l=BN(s,a,r),u=new Af(s,l,o),c=new Af(a,l,o);r.iterGaps((f,h,d)=>FN(u,f,c,h,d,i)),r.empty&&r.length==0&&FN(u,0,c,0,0,i)}static eq(t,n,r=0,i){i==null&&(i=999999999);let o=t.filter(c=>!c.isEmpty&&n.indexOf(c)<0),s=n.filter(c=>!c.isEmpty&&t.indexOf(c)<0);if(o.length!=s.length)return!1;if(!o.length)return!0;let a=BN(o,s),l=new Af(o,a,0).goto(r),u=new Af(s,a,0).goto(r);for(;;){if(l.to!=u.to||!Zk(l.active,u.active)||l.point&&(!u.point||!jP(l.point,u.point)))return!1;if(l.to>i)return!0;l.next(),u.next()}}static spans(t,n,r,i,o=-1){let s=new Af(t,null,o).goto(n),a=n,l=s.openStart;for(;;){let u=Math.min(s.to,r);if(s.point){let c=s.activeForPoint(s.to),f=s.pointFrom<n?c.length+1:s.point.startSide<0?c.length:Math.min(c.length,l);i.point(a,u,s.point,c,f,s.pointRank),l=Math.min(s.openEnd(u),c.length)}else u>a&&(i.span(a,u,s.active,l),l=s.openEnd(u));if(s.to>r)return l+(s.point&&s.to>r?1:0);a=s.to,s.next()}}static of(t,n=!1){let r=new Io;for(let i of t instanceof Xk?[t]:n?mje(t):t)r.add(i.from,i.to,i.value);return r.finish()}static join(t){if(!t.length)return _e.empty;let n=t[t.length-1];for(let r=t.length-2;r>=0;r--)for(let i=t[r];i!=_e.empty;i=i.nextLayer)n=new _e(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}_e.empty=new _e([],[],null,-1);function mje(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(Yk(t,r)>0)return e.slice().sort(Yk);t=r}return e}_e.empty.nextLayer=_e.empty;class Io{finishChunk(t){this.chunks.push(new MP(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,r){this.addInner(t,n,r)||(this.nextLayer||(this.nextLayer=new Io)).add(t,n,r)}addInner(t,n,r){let i=t-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(t-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=t,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-t)),!0)}addChunk(t,n){if((t-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(t);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+t,this.lastTo=n.to[r]+t,!0}finish(){return this.finishInner(_e.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let n=_e.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,n}}function BN(e,t,n){let r=new Map;for(let o of e)for(let s=0;s<o.chunk.length;s++)o.chunk[s].maxPoint<=0&&r.set(o.chunk[s],o.chunkPos[s]);let i=new Set;for(let o of t)for(let s=0;s<o.chunk.length;s++){let a=r.get(o.chunk[s]);a!=null&&(n?n.mapPos(a):a)==o.chunkPos[s]&&!n?.touchesRange(a,a+o.chunk[s].length)&&i.add(o.chunk[s])}return i}class O6{constructor(t,n,r,i=0){this.layer=t,this.skip=n,this.minPoint=r,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(t,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,n,!1),this}gotoInner(t,n,r){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<t||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(t-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(t,n){(this.to-t||this.endSide-n)<0&&this.gotoInner(t,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let t=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],r=t+n.from[this.rangeIndex];if(this.from=r,this.to=t+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=t}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(t){return this.from-t.from||this.startSide-t.startSide||this.rank-t.rank||this.to-t.to||this.endSide-t.endSide}}class Td{constructor(t){this.heap=t}static from(t,n=null,r=-1){let i=[];for(let o=0;o<t.length;o++)for(let s=t[o];!s.isEmpty;s=s.nextLayer)s.maxPoint>=r&&i.push(new O6(s,n,r,o));return i.length==1?i[0]:new Td(i)}get startSide(){return this.value?this.value.startSide:0}goto(t,n=-1e9){for(let r of this.heap)r.goto(t,n);for(let r=this.heap.length>>1;r>=0;r--)o1(this.heap,r);return this.next(),this}forward(t,n){for(let r of this.heap)r.forward(t,n);for(let r=this.heap.length>>1;r>=0;r--)o1(this.heap,r);(this.to-t||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),o1(this.heap,0)}}}function o1(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}class Af{constructor(t,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Td.from(t,n,r)}goto(t,n=-1e9){return this.cursor.goto(t,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=n,this.openStart=-1,this.next(),this}forward(t,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(t,n)}removeActive(t){um(this.active,t),um(this.activeTo,t),um(this.activeRank,t),this.minActive=zN(this.active,this.activeTo)}addActive(t){let n=0,{value:r,to:i,rank:o}=this.cursor;for(;n<this.activeRank.length&&(o-this.activeRank[n]||i-this.activeTo[n])>0;)n++;cm(this.active,n,r),cm(this.activeTo,n,i),cm(this.activeRank,n,o),t&&cm(t,n,this.cursor.from),this.minActive=zN(this.active,this.activeTo)}next(){let t=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>t){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&um(r,i)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=o,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=o.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let i=r.length-1;i>=0&&r[i]<t;i--)this.openStart++}}activeForPoint(t){if(!this.active.length)return this.active;let n=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>t||this.activeTo[r]==t&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(t){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>t;r--)n++;return n}}function FN(e,t,n,r,i,o){e.goto(t),n.goto(r);let s=r+i,a=r,l=r-t,u=!!o.boundChange;for(let c=!1;;){let f=e.to+l-n.to,h=f||e.endSide-n.endSide,d=h<0?e.to+l:n.to,p=Math.min(d,s);if(e.point||n.point?(e.point&&n.point&&jP(e.point,n.point)&&Zk(e.activeForPoint(e.to),n.activeForPoint(n.to))||o.comparePoint(a,p,e.point,n.point),c=!1):(c&&o.boundChange(a),p>a&&!Zk(e.active,n.active)&&o.compareRange(a,p,e.active,n.active),u&&p<s&&(f||e.openEnd(d)!=n.openEnd(d))&&(c=!0)),d>s)break;a=d,h<=0&&e.next(),h>=0&&n.next()}}function Zk(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!jP(e[n],t[n]))return!1;return!0}function um(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function cm(e,t,n){for(let r=e.length-1;r>=t;r--)e[r+1]=e[r];e[t]=n}function zN(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)(t[i]-r||e[i].endSide-e[n].endSide)<0&&(n=i,r=t[i]);return n}function qc(e,t,n=e.length){let r=0;for(let i=0;i<n&&i<e.length;)e.charCodeAt(i)==9?(r+=t-r%t,i++):(r++,i=Jt(e,i));return r}function Jk(e,t,n,r){for(let i=0,o=0;;){if(o>=t)return i;if(i==e.length)break;o+=e.charCodeAt(i)==9?n-o%n:1,i=Jt(e,i)}return r===!0?-1:e.length}const eO="ͼ",WN=typeof Symbol>"u"?"__"+eO:Symbol.for(eO),tO=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),UN=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Ms{constructor(t,n){this.rules=[];let{finish:r}=n||{};function i(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function o(s,a,l,u){let c=[],f=/^@(\w+)\b/.exec(s[0]),h=f&&f[1]=="keyframes";if(f&&a==null)return l.push(s[0]+";");for(let d in a){let p=a[d];if(/&/.test(d))o(d.split(/,\s*/).map(m=>s.map(v=>m.replace(/&/,v))).reduce((m,v)=>m.concat(v)),p,l);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");o(i(d),p,c,h)}else p!=null&&c.push(d.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(c.length||h)&&l.push((r&&!f&&!u?s.map(r):s).join(", ")+" {"+c.join(" ")+"}")}for(let s in t)o(i(s),t[s],this.rules)}getRules(){return this.rules.join(`
|
|
434
|
-
`)}static newName(){let t=UN[WN]||1;return UN[WN]=t+1,eO+t.toString(36)}static mount(t,n,r){let i=t[tO],o=r&&r.nonce;i?o&&i.setNonce(o):i=new gje(t,o),i.mount(Array.isArray(n)?n:[n],t)}}let HN=new Map;class gje{constructor(t,n){let r=t.ownerDocument||t,i=r.defaultView;if(!t.head&&t.adoptedStyleSheets&&i.CSSStyleSheet){let o=HN.get(r);if(o)return t[tO]=o;this.sheet=new i.CSSStyleSheet,HN.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],t[tO]=this}mount(t,n){let r=this.sheet,i=0,o=0;for(let s=0;s<t.length;s++){let a=t[s],l=this.modules.indexOf(a);if(l<o&&l>-1&&(this.modules.splice(l,1),o--,l=-1),l==-1){if(this.modules.splice(o++,0,a),r)for(let u=0;u<a.rules.length;u++)r.insertRule(a.rules[u],i++)}else{for(;o<l;)i+=this.modules[o++].rules.length;i+=a.rules.length,o++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let s="";for(let l=0;l<this.modules.length;l++)s+=this.modules[l].getRules()+`
|
|
435
|
-
`;this.styleTag.textContent=s;let a=n.head||n;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(t){this.styleTag&&this.styleTag.getAttribute("nonce")!=t&&this.styleTag.setAttribute("nonce",t)}}var Is={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},_d={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},yje=typeof navigator<"u"&&/Mac/.test(navigator.platform),vje=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var ln=0;ln<10;ln++)Is[48+ln]=Is[96+ln]=String(ln);for(var ln=1;ln<=24;ln++)Is[ln+111]="F"+ln;for(var ln=65;ln<=90;ln++)Is[ln]=String.fromCharCode(ln+32),_d[ln]=String.fromCharCode(ln);for(var s1 in Is)_d.hasOwnProperty(s1)||(_d[s1]=Is[s1]);function bje(e){var t=yje&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||vje&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?_d:Is)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function Ke(){var e=arguments[0];typeof e=="string"&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i=="string"?e.setAttribute(r,i):i!=null&&(e[r]=i)}t++}for(;t<arguments.length;t++)C6(e,arguments[t]);return e}function C6(e,t){if(typeof t=="string")e.appendChild(document.createTextNode(t));else if(t!=null)if(t.nodeType!=null)e.appendChild(t);else if(Array.isArray(t))for(var n=0;n<t.length;n++)C6(e,t[n]);else throw new RangeError("Unsupported child node: "+t)}let En=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},nO=typeof document<"u"?document:{documentElement:{style:{}}};const rO=/Edge\/(\d+)/.exec(En.userAgent),A6=/MSIE \d/.test(En.userAgent),iO=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(En.userAgent),sb=!!(A6||iO||rO),VN=!sb&&/gecko\/(\d+)/i.test(En.userAgent),a1=!sb&&/Chrome\/(\d+)/.exec(En.userAgent),qN="webkitFontSmoothing"in nO.documentElement.style,oO=!sb&&/Apple Computer/.test(En.vendor),KN=oO&&(/Mobile\/\w+/.test(En.userAgent)||En.maxTouchPoints>2);var oe={mac:KN||/Mac/.test(En.platform),windows:/Win/.test(En.platform),linux:/Linux|X11/.test(En.platform),ie:sb,ie_version:A6?nO.documentMode||6:iO?+iO[1]:rO?+rO[1]:0,gecko:VN,gecko_version:VN?+(/Firefox\/(\d+)/.exec(En.userAgent)||[0,0])[1]:0,chrome:!!a1,chrome_version:a1?+a1[1]:0,ios:KN,android:/Android\b/.test(En.userAgent),webkit:qN,webkit_version:qN?+(/\bAppleWebKit\/(\d+)/.exec(En.userAgent)||[0,0])[1]:0,safari:oO,safari_version:oO?+(/\bVersion\/(\d+(\.\d+)?)/.exec(En.userAgent)||[0,0])[1]:0,tabSize:nO.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function IP(e,t){for(let n in e)n=="class"&&t.class?t.class+=" "+e.class:n=="style"&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}const iv=Object.create(null);function NP(e,t,n){if(e==t)return!0;e||(e=iv),t||(t=iv);let r=Object.keys(e),i=Object.keys(t);if(r.length-0!=i.length-0)return!1;for(let o of r)if(o!=n&&(i.indexOf(o)==-1||e[o]!==t[o]))return!1;return!0}function xje(e,t){for(let n=e.attributes.length-1;n>=0;n--){let r=e.attributes[n].name;t[r]==null&&e.removeAttribute(r)}for(let n in t){let r=t[n];n=="style"?e.style.cssText=r:e.getAttribute(n)!=r&&e.setAttribute(n,r)}}function GN(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,i=="style"?e.style.cssText="":e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,i=="style"?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}function wje(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}class eo{eq(t){return!1}updateDOM(t,n,r){return!1}compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(t){return!0}coordsAt(t,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(t){}}var fn=function(e){return e[e.Text=0]="Text",e[e.WidgetBefore=1]="WidgetBefore",e[e.WidgetAfter=2]="WidgetAfter",e[e.WidgetRange=3]="WidgetRange",e}(fn||(fn={}));class de extends js{constructor(t,n,r,i){super(),this.startSide=t,this.endSide=n,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(t){return new up(t)}static widget(t){let n=Math.max(-1e4,Math.min(1e4,t.side||0)),r=!!t.block;return n+=r&&!t.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new nl(t,n,n,r,t.widget||null,!1)}static replace(t){let n=!!t.block,r,i;if(t.isBlockGap)r=-5e8,i=4e8;else{let{start:o,end:s}=P6(t,n);r=(o?n?-3e8:-1:5e8)-1,i=(s?n?2e8:1:-6e8)+1}return new nl(t,r,i,n,t.widget||null,!0)}static line(t){return new cp(t)}static set(t,n=!1){return _e.of(t,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}de.none=_e.empty;class up extends de{constructor(t){let{start:n,end:r}=P6(t);super(n?-1:5e8,r?1:-6e8,null,t),this.tagName=t.tagName||"span",this.attrs=t.class&&t.attributes?IP(t.attributes,{class:t.class}):t.class?{class:t.class}:t.attributes||iv}eq(t){return this==t||t instanceof up&&this.tagName==t.tagName&&NP(this.attrs,t.attrs)}range(t,n=t){if(t>=n)throw new RangeError("Mark decorations may not be empty");return super.range(t,n)}}up.prototype.point=!1;class cp extends de{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof cp&&this.spec.class==t.spec.class&&NP(this.spec.attributes,t.spec.attributes)}range(t,n=t){if(n!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,n)}}cp.prototype.mapMode=jn.TrackBefore;cp.prototype.point=!0;class nl extends de{constructor(t,n,r,i,o,s){super(n,r,o,t),this.block=i,this.isReplace=s,this.mapMode=i?n<=0?jn.TrackBefore:jn.TrackAfter:jn.TrackDel}get type(){return this.startSide!=this.endSide?fn.WidgetRange:this.startSide<=0?fn.WidgetBefore:fn.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof nl&&Sje(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,n=t){if(this.isReplace&&(t>n||t==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,n)}}nl.prototype.point=!0;function P6(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return n==null&&(n=e.inclusive),r==null&&(r=e.inclusive),{start:n??t,end:r??t}}function Sje(e,t){return e==t||!!(e&&t&&e.compare(t))}function Au(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}class jd extends js{constructor(t,n){super(),this.tagName=t,this.attributes=n}eq(t){return t==this||t instanceof jd&&this.tagName==t.tagName&&NP(this.attributes,t.attributes)}static create(t){return new jd(t.tagName,t.attributes||iv)}static set(t,n=!1){return _e.of(t,n)}}jd.prototype.startSide=jd.prototype.endSide=-1;function Md(e){let t;return e.nodeType==11?t=e.getSelection?e:e.ownerDocument:t=e,t.getSelection()}function sO(e,t){return t?e==t||e.contains(t.nodeType!=1?t.parentNode:t):!1}function uh(e,t){if(!t.anchorNode)return!1;try{return sO(e,t.anchorNode)}catch{return!1}}function ch(e){return e.nodeType==3?Nd(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function fh(e,t,n,r){return n?QN(e,t,n,r,-1)||QN(e,t,n,r,1):!1}function Ns(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function ov(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function QN(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:No(e))){if(e.nodeName=="DIV")return!1;let o=e.parentNode;if(!o||o.nodeType!=1)return!1;t=Ns(e)+(i<0?0:1),e=o}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.nodeType==1&&e.contentEditable=="false")return!1;t=i<0?No(e):0}else return!1}}function No(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Id(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function kje(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function E6(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function Oje(e,t,n,r,i,o,s,a){let l=e.ownerDocument,u=l.defaultView||window;for(let c=e,f=!1;c&&!f;)if(c.nodeType==1){let h,d=c==l.body,p=1,m=1;if(d)h=kje(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(f=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let y=c.getBoundingClientRect();({scaleX:p,scaleY:m}=E6(c,y)),h={left:y.left,right:y.left+c.clientWidth*p,top:y.top,bottom:y.top+c.clientHeight*m}}let v=0,b=0;if(i=="nearest")t.top<h.top+s?(b=t.top-(h.top+s),n>0&&t.bottom>h.bottom+b&&(b=t.bottom-h.bottom+s)):t.bottom>h.bottom-s&&(b=t.bottom-h.bottom+s,n<0&&t.top-b<h.top&&(b=t.top-(h.top+s)));else{let y=t.bottom-t.top,x=h.bottom-h.top;b=(i=="center"&&y<=x?t.top+y/2-x/2:i=="start"||i=="center"&&n<0?t.top-s:t.bottom-x+s)-h.top}if(r=="nearest"?t.left<h.left+o?(v=t.left-(h.left+o),n>0&&t.right>h.right+v&&(v=t.right-h.right+o)):t.right>h.right-o&&(v=t.right-h.right+o,n<0&&t.left<h.left+v&&(v=t.left-(h.left+o))):v=(r=="center"?t.left+(t.right-t.left)/2-(h.right-h.left)/2:r=="start"==a?t.left-o:t.right-(h.right-h.left)+o)-h.left,v||b)if(d)u.scrollBy(v,b);else{let y=0,x=0;if(b){let k=c.scrollTop;c.scrollTop+=b/m,x=(c.scrollTop-k)*m}if(v){let k=c.scrollLeft;c.scrollLeft+=v/p,y=(c.scrollLeft-k)*p}t={left:t.left-y,top:t.top-x,right:t.right-y,bottom:t.bottom-x},y&&Math.abs(y-v)<1&&(r="nearest"),x&&Math.abs(x-b)<1&&(i="nearest")}if(d)break;(t.top<h.top||t.bottom>h.bottom||t.left<h.left||t.right>h.right)&&(t={left:Math.max(t.left,h.left),right:Math.min(t.right,h.right),top:Math.max(t.top,h.top),bottom:Math.min(t.bottom,h.bottom)}),c=c.assignedSlot||c.parentNode}else if(c.nodeType==11)c=c.host;else break}function T6(e,t=!0){let n=e.ownerDocument,r=null,i=null;for(let o=e.parentNode;o&&!(o==n.body||(!t||r)&&i);)if(o.nodeType==1)!i&&o.scrollHeight>o.clientHeight&&(i=o),t&&!r&&o.scrollWidth>o.clientWidth&&(r=o),o=o.assignedSlot||o.parentNode;else if(o.nodeType==11)o=o.host;else break;return{x:r,y:i}}class Cje{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:n,focusNode:r}=t;this.set(n,Math.min(t.anchorOffset,n?No(n):0),r,Math.min(t.focusOffset,r?No(r):0))}set(t,n,r,i){this.anchorNode=t,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let fa=null;oe.safari&&oe.safari_version>=26&&(fa=!1);function _6(e){if(e.setActive)return e.setActive();if(fa)return e.focus(fa);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(fa==null?{get preventScroll(){return fa={preventScroll:!0},!0}}:void 0),!fa){fa=!1;for(let n=0;n<t.length;){let r=t[n++],i=t[n++],o=t[n++];r.scrollTop!=i&&(r.scrollTop=i),r.scrollLeft!=o&&(r.scrollLeft=o)}}}let XN;function Nd(e,t,n=t){let r=XN||(XN=document.createRange());return r.setEnd(e,n),r.setStart(e,t),r}function Pu(e,t,n,r){let i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let o=new KeyboardEvent("keydown",i);o.synthetic=!0,e.dispatchEvent(o);let s=new KeyboardEvent("keyup",i);return s.synthetic=!0,e.dispatchEvent(s),o.defaultPrevented||s.defaultPrevented}function Aje(e){for(;e;){if(e&&(e.nodeType==9||e.nodeType==11&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function Pje(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,No(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=No(n))}else{if(n==e)return!0;r=Ns(n),n=n.parentNode}}function j6(e){return e instanceof Window?e.pageYOffset>Math.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function M6(e,t){for(let n=e,r=t;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=No(n)}else if(n.parentNode&&!ov(n))r=Ns(n),n=n.parentNode;else return null}}function I6(e,t){for(let n=e,r=t;;){if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!ov(n))r=Ns(n)+1,n=n.parentNode;else return null}}class fi{constructor(t,n,r=!0){this.node=t,this.offset=n,this.precise=r}static before(t,n){return new fi(t.parentNode,Ns(t),n)}static after(t,n){return new fi(t.parentNode,Ns(t)+1,n)}}var Je=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(Je||(Je={}));const rl=Je.LTR,RP=Je.RTL;function N6(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<+e[n]);return t}const Eje=N6("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),Tje=N6("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),aO=Object.create(null),ki=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),n=e.charCodeAt(1);aO[t]=n,aO[n]=-t}function R6(e){return e<=247?Eje[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?Tje[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}const _je=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Li{get dir(){return this.level%2?RP:rl}constructor(t,n,r){this.from=t,this.to=n,this.level=r}side(t,n){return this.dir==n==t?this.to:this.from}forward(t,n){return t==(this.dir==n)}static find(t,n,r,i){let o=-1;for(let s=0;s<t.length;s++){let a=t[s];if(a.from<=n&&a.to>=n){if(a.level==r)return s;(o<0||(i!=0?i<0?a.from<n:a.to>n:t[o].level>a.level))&&(o=s)}}if(o<0)throw new RangeError("Index out of range");return o}}function D6(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!D6(r.inner,i.inner))return!1}return!0}const Ye=[];function jje(e,t,n,r,i){for(let o=0;o<=r.length;o++){let s=o?r[o-1].to:t,a=o<r.length?r[o].from:n,l=o?256:i;for(let u=s,c=l,f=l;u<a;u++){let h=R6(e.charCodeAt(u));h==512?h=c:h==8&&f==4&&(h=16),Ye[u]=h==4?2:h,h&7&&(f=h),c=h}for(let u=s,c=l,f=l;u<a;u++){let h=Ye[u];if(h==128)u<a-1&&c==Ye[u+1]&&c&24?h=Ye[u]=c:Ye[u]=256;else if(h==64){let d=u+1;for(;d<a&&Ye[d]==64;)d++;let p=u&&c==8||d<n&&Ye[d]==8?f==1?1:8:256;for(let m=u;m<d;m++)Ye[m]=p;u=d-1}else h==8&&f==1&&(Ye[u]=1);c=h,h&7&&(f=h)}}}function Mje(e,t,n,r,i){let o=i==1?2:1;for(let s=0,a=0,l=0;s<=r.length;s++){let u=s?r[s-1].to:t,c=s<r.length?r[s].from:n;for(let f=u,h,d,p;f<c;f++)if(d=aO[h=e.charCodeAt(f)])if(d<0){for(let m=a-3;m>=0;m-=3)if(ki[m+1]==-d){let v=ki[m+2],b=v&2?i:v&4?v&1?o:i:0;b&&(Ye[f]=Ye[ki[m]]=b),a=m;break}}else{if(ki.length==189)break;ki[a++]=f,ki[a++]=h,ki[a++]=l}else if((p=Ye[f])==2||p==1){let m=p==i;l=m?0:1;for(let v=a-3;v>=0;v-=3){let b=ki[v+2];if(b&2)break;if(m)ki[v+2]|=2;else{if(b&4)break;ki[v+2]|=4}}}}}function Ije(e,t,n,r){for(let i=0,o=r;i<=n.length;i++){let s=i?n[i-1].to:e,a=i<n.length?n[i].from:t;for(let l=s;l<a;){let u=Ye[l];if(u==256){let c=l+1;for(;;)if(c==a){if(i==n.length)break;c=n[i++].to,a=i<n.length?n[i].from:t}else if(Ye[c]==256)c++;else break;let f=o==1,h=(c<t?Ye[c]:r)==1,d=f==h?f?1:2:r;for(let p=c,m=i,v=m?n[m-1].to:e;p>l;)p==v&&(p=n[--m].from,v=m?n[m-1].to:e),Ye[--p]=d;l=c}else o=u,l++}}}function lO(e,t,n,r,i,o,s){let a=r%2?2:1;if(r%2==i%2)for(let l=t,u=0;l<n;){let c=!0,f=!1;if(u==o.length||l<o[u].from){let m=Ye[l];m!=a&&(c=!1,f=m==16)}let h=!c&&a==1?[]:null,d=c?r:r+1,p=l;e:for(;;)if(u<o.length&&p==o[u].from){if(f)break e;let m=o[u];if(!c)for(let v=m.to,b=u+1;;){if(v==n)break e;if(b<o.length&&o[b].from==v)v=o[b++].to;else{if(Ye[v]==a)break e;break}}if(u++,h)h.push(m);else{m.from>l&&s.push(new Li(l,m.from,d));let v=m.direction==rl!=!(d%2);uO(e,v?r+1:r,i,m.inner,m.from,m.to,s),l=m.to}p=m.to}else{if(p==n||(c?Ye[p]!=a:Ye[p]==a))break;p++}h?lO(e,l,p,r+1,i,h,s):l<p&&s.push(new Li(l,p,d)),l=p}else for(let l=n,u=o.length;l>t;){let c=!0,f=!1;if(!u||l>o[u-1].to){let m=Ye[l-1];m!=a&&(c=!1,f=m==16)}let h=!c&&a==1?[]:null,d=c?r:r+1,p=l;e:for(;;)if(u&&p==o[u-1].to){if(f)break e;let m=o[--u];if(!c)for(let v=m.from,b=u;;){if(v==t)break e;if(b&&o[b-1].to==v)v=o[--b].from;else{if(Ye[v-1]==a)break e;break}}if(h)h.push(m);else{m.to<l&&s.push(new Li(m.to,l,d));let v=m.direction==rl!=!(d%2);uO(e,v?r+1:r,i,m.inner,m.from,m.to,s),l=m.from}p=m.from}else{if(p==t||(c?Ye[p-1]!=a:Ye[p-1]==a))break;p--}h?lO(e,p,l,r+1,i,h,s):p<l&&s.push(new Li(p,l,d)),l=p}}function uO(e,t,n,r,i,o,s){let a=t%2?2:1;jje(e,i,o,r,a),Mje(e,i,o,r,a),Ije(i,o,r,a),lO(e,i,o,t,n,r,s)}function Nje(e,t,n){if(!e)return[new Li(0,0,t==RP?1:0)];if(t==rl&&!n.length&&!_je.test(e))return L6(e.length);if(n.length)for(;e.length>Ye.length;)Ye[Ye.length]=256;let r=[],i=t==rl?0:1;return uO(e,i,i,n,0,e.length,r),r}function L6(e){return[new Li(0,e,0)]}let $6="";function Rje(e,t,n,r,i){var o;let s=r.head-e.from,a=Li.find(t,s,(o=r.bidiLevel)!==null&&o!==void 0?o:-1,r.assoc),l=t[a],u=l.side(i,n);if(s==u){let h=a+=i?1:-1;if(h<0||h>=t.length)return null;l=t[a=h],s=l.side(!i,n),u=l.side(i,n)}let c=Jt(e.text,s,l.forward(i,n));(c<l.from||c>l.to)&&(c=u),$6=e.text.slice(Math.min(s,c),Math.max(s,c));let f=a==(i?t.length-1:0)?null:t[a+(i?1:-1)];return f&&c==u&&f.level+(i?0:1)<l.level?V.cursor(f.side(!i,n)+e.from,f.forward(i,n)?1:-1,f.level):V.cursor(c+e.from,l.forward(i,n)?-1:1,l.level)}function Dje(e,t,n){for(let r=t;r<n;r++){let i=R6(e.charCodeAt(r));if(i==1)return rl;if(i==2||i==4)return RP}return rl}const B6=se.define(),F6=se.define(),z6=se.define(),W6=se.define(),cO=se.define(),U6=se.define(),H6=se.define(),DP=se.define(),LP=se.define(),V6=se.define({combine:e=>e.some(t=>t)}),q6=se.define({combine:e=>e.some(t=>t)}),K6=se.define();class Eu{constructor(t,n,r,i,o,s=!1){this.range=t,this.y=n,this.x=r,this.yMargin=i,this.xMargin=o,this.isSnapshot=s}map(t){return t.empty?this:new Eu(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new Eu(V.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const fm=ke.define({map:(e,t)=>e.map(t)}),G6=ke.define();function Gn(e,t,n){let r=e.facet(W6);r.length?r[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}const co=se.define({combine:e=>e.length?e[0]:!0});let Lje=0;const au=se.define({combine(e){return e.filter((t,n)=>{for(let r=0;r<n;r++)if(e[r].plugin==t.plugin)return!1;return!0})}});class Et{constructor(t,n,r,i,o){this.id=t,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.baseExtensions=o(this),this.extension=this.baseExtensions.concat(au.of({plugin:this,arg:void 0}))}of(t){return this.baseExtensions.concat(au.of({plugin:this,arg:t}))}static define(t,n){const{eventHandlers:r,eventObservers:i,provide:o,decorations:s}=n||{};return new Et(Lje++,t,r,i,a=>{let l=[];return s&&l.push(ab.of(u=>{let c=u.plugin(a);return c?s(c):de.none})),o&&l.push(o(a)),l})}static fromClass(t,n){return Et.define((r,i)=>new t(r,i),n)}}class l1{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(t){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(Gn(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(t,this.spec.arg)}catch(n){Gn(t.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){Gn(t.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Q6=se.define(),$P=se.define(),ab=se.define(),X6=se.define(),BP=se.define(),fp=se.define(),Y6=se.define();function YN(e,t){let n=e.state.facet(Y6);if(!n.length)return n;let r=n.map(o=>o instanceof Function?o(e):o),i=[];return _e.spans(r,t.from,t.to,{point(){},span(o,s,a,l){let u=o-t.from,c=s-t.from,f=i;for(let h=a.length-1;h>=0;h--,l--){let d=a[h].spec.bidiIsolate,p;if(d==null&&(d=Dje(t.text,u,c)),l>0&&f.length&&(p=f[f.length-1]).to==u&&p.direction==d)p.to=c,f=p.inner;else{let m={from:u,to:c,direction:d,inner:[]};f.push(m),f=m.inner}}}}),i}const Z6=se.define();function FP(e){let t=0,n=0,r=0,i=0;for(let o of e.state.facet(Z6)){let s=o(e);s&&(s.left!=null&&(t=Math.max(t,s.left)),s.right!=null&&(n=Math.max(n,s.right)),s.top!=null&&(r=Math.max(r,s.top)),s.bottom!=null&&(i=Math.max(i,s.bottom)))}return{left:t,right:n,top:r,bottom:i}}const $f=se.define();class zr{constructor(t,n,r,i){this.fromA=t,this.toA=n,this.fromB=r,this.toB=i}join(t){return new zr(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let n=t.length,r=this;for(;n>0;n--){let i=t[n-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),t.splice(n-1,1)}}return t.splice(n,0,r),t}static extendWithRanges(t,n){if(n.length==0)return t;let r=[];for(let i=0,o=0,s=0;;){let a=i<t.length?t[i].fromB:1e9,l=o<n.length?n[o]:1e9,u=Math.min(a,l);if(u==1e9)break;let c=u+s,f=u,h=c;for(;;)if(o<n.length&&n[o]<=f){let d=n[o+1];o+=2,f=Math.max(f,d);for(let p=i;p<t.length&&t[p].fromB<=f;p++)s=t[p].toA-t[p].toB;h=Math.max(h,d+s)}else if(i<t.length&&t[i].fromB<=f){let d=t[i++];f=Math.max(f,d.toB),h=Math.max(h,d.toA),s=d.toA-d.toB}else break;r.push(new zr(c,h,u,f))}return r}}class sv{constructor(t,n,r){this.view=t,this.state=n,this.transactions=r,this.flags=0,this.startState=t.state,this.changes=zt.empty(this.startState.doc.length);for(let o of r)this.changes=this.changes.compose(o.changes);let i=[];this.changes.iterChangedRanges((o,s,a,l)=>i.push(new zr(o,s,a,l))),this.changedRanges=i}static create(t,n,r){return new sv(t,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const $je=[];class Pt{constructor(t,n,r=0){this.dom=t,this.length=n,this.flags=r,this.parent=null,t.cmTile=this}get breakAfter(){return this.flags&1}get children(){return $je}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(t){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&xje(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(t){this.dom=t,t.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t,n=this.posAtStart){let r=n;for(let i of this.children){if(i==t)return r;r+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}covers(t){return!0}coordsIn(t,n){return null}domPosFor(t,n){let r=Ns(this.dom),i=this.length?t>0:n>0;return new fi(this.parent.dom,r+(i?1:0),t==0||t==this.length)}markDirty(t){this.flags&=-3,t&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let t=this;t;t=t.parent)if(t instanceof ub)return t;return null}static get(t){return t.cmTile}}class lb extends Pt{constructor(t){super(t,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(t){this.children.push(t),t.parent=this}sync(t){if(this.flags&2)return;super.sync(t);let n=this.dom,r=null,i,o=t?.node==n?t:null,s=0;for(let a of this.children){if(a.sync(t),s+=a.length+a.breakAfter,i=r?r.nextSibling:n.firstChild,o&&i!=a.dom&&(o.written=!0),a.dom.parentNode==n)for(;i&&i!=a.dom;)i=ZN(i);else n.insertBefore(a.dom,i);r=a.dom}for(i=r?r.nextSibling:n.firstChild,o&&i&&(o.written=!0);i;)i=ZN(i);this.length=s}}function ZN(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class ub extends lb{constructor(t,n){super(n),this.view=t}owns(t){for(;t;t=t.parent)if(t==this)return!0;return!1}isBlock(){return!0}nearest(t){for(;;){if(!t)return null;let n=Pt.get(t);if(n&&this.owns(n))return n;t=t.parentNode}}blockTiles(t){for(let n=[],r=this,i=0,o=0;;)if(i==r.children.length){if(!n.length)return;r=r.parent,r.breakAfter&&o++,i=n.pop()}else{let s=r.children[i++];if(s instanceof Oo)n.push(i),r=s,i=0;else{let a=o+s.length,l=t(s,o);if(l!==void 0)return l;o=a+s.breakAfter}}}resolveBlock(t,n){let r,i=-1,o,s=-1;if(this.blockTiles((a,l)=>{let u=l+a.length;if(t>=l&&t<=u){if(a.isWidget()&&n>=-1&&n<=1){if(a.flags&32)return!0;a.flags&16&&(r=void 0)}(l<t||t==u&&(n<-1?a.length:a.covers(1)))&&(!r||!a.isWidget()&&r.isWidget())&&(r=a,i=t-l),(u>t||t==l&&(n>1?a.length:a.covers(-1)))&&(!o||!a.isWidget()&&o.isWidget())&&(o=a,s=t-l)}}),!r&&!o)throw new Error("No tile at position "+t);return r&&n<0||!o?{tile:r,offset:i}:{tile:o,offset:s}}}class Oo extends lb{constructor(t,n){super(t),this.wrapper=n}isBlock(){return!0}covers(t){return this.children.length?t<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let r=new Oo(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}}class gc extends lb{constructor(t,n){super(t),this.attrs=n}isLine(){return!0}static start(t,n,r){let i=new gc(n||document.createElement("div"),t);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(t,n,r){let i=null,o=-1,s=null,a=-1;function l(c,f){for(let h=0,d=0;h<c.children.length&&d<=f;h++){let p=c.children[h],m=d+p.length;m>=f&&(p.isComposite()?l(p,f-d):(!s||s.isHidden&&(n>0||r&&Fje(s,p)))&&(m>f||p.flags&32)?(s=p,a=f-d):(d<f||p.flags&16&&!p.isHidden)&&(i=p,o=f-d)),d=m}}l(this,t);let u=(n<0?i:s)||i||s;return u?{tile:u,offset:u==i?o:a}:null}coordsIn(t,n){let r=this.resolveInline(t,n,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),n):Bje(this)}domIn(t,n){let r=this.resolveInline(t,n);if(r){let{tile:i,offset:o}=r;if(this.dom.contains(i.dom))return i.isText()?new fi(i.dom,Math.min(i.dom.nodeValue.length,o)):i.domPosFor(o,i.flags&16?1:i.flags&32?-1:n);let s=r.tile.parent,a=!1;for(let l of s.children){if(a)return new fi(l.dom,0);l==r.tile&&(a=!0)}}return new fi(this.dom,0)}}function Bje(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=ch(t);return n[n.length-1]||null}function Fje(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}class Un extends lb{constructor(t,n){super(t),this.mark=n}get domAttrs(){return this.mark.attrs}static of(t,n){let r=new Un(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}}class Pa extends Pt{constructor(t,n){super(t,n.length),this.text=n}sync(t){this.flags&2||(super.sync(t),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(t,n){let r=this.dom.nodeValue.length;t>r&&(t=r);let i=t,o=t,s=0;t==0&&n<0||t==r&&n>=0?oe.chrome||oe.gecko||(t?(i--,s=1):o<r&&(o++,s=-1)):n<0?i--:o<r&&o++;let a=Nd(this.dom,i,o).getClientRects();if(!a.length)return null;let l=a[(s?s<0:n>=0)?0:a.length-1];return oe.safari&&!s&&l.width==0&&(l=Array.prototype.find.call(a,u=>u.width)||l),s?Id(l,s<0):l||null}static of(t,n){let r=new Pa(n||document.createTextNode(t),t);return n||(r.flags|=2),r}}class il extends Pt{constructor(t,n,r,i){super(t,n,i),this.widget=r}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(t){return this.flags&48?!1:(this.flags&(t<0?64:128))>0}coordsIn(t,n){return this.coordsInWidget(t,n,!1)}coordsInWidget(t,n,r){let i=this.widget.coordsAt(this.dom,t,n);if(i)return i;if(r)return Id(this.dom.getBoundingClientRect(),this.length?t==0:n<=0);{let o=this.dom.getClientRects(),s=null;if(!o.length)return null;let a=this.flags&16?!0:this.flags&32?!1:t>0;for(let l=a?o.length-1:0;s=o[l],!(t>0?l==0:l==o.length-1||s.top<s.bottom);l+=a?-1:1);return Id(s,!a)}}get overrideDOMText(){if(!this.length)return Re.empty;let{root:t}=this;if(!t)return Re.empty;let n=this.posAtStart;return t.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(t,n,r,i,o){return o||(o=t.toDOM(n),t.editable||(o.contentEditable="false")),new il(o,r,t,i)}}class av extends Pt{constructor(t){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,t)}get isHidden(){return!0}get overrideDOMText(){return Re.empty}coordsIn(t){return this.dom.getBoundingClientRect()}}class zje{constructor(t){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=t}advance(t,n,r){let{tile:i,index:o,beforeBreak:s,parents:a}=this;for(;t||n>0;)if(i.isComposite())if(s){if(!t)break;r&&r.break(),t--,s=!1}else if(o==i.children.length){if(!t&&!a.length)break;r&&r.leave(i),s=!!i.breakAfter,{tile:i,index:o}=a.pop(),o++}else{let l=i.children[o],u=l.breakAfter;(n>0?l.length<=t:l.length<t)&&(!r||r.skip(l,0,l.length)!==!1||!l.isComposite)?(s=!!u,o++,t-=l.length):(a.push({tile:i,index:o}),i=l,o=0,r&&l.isComposite()&&r.enter(l))}else if(o==i.length)s=!!i.breakAfter,{tile:i,index:o}=a.pop(),o++;else if(t){let l=Math.min(t,i.length-o);r&&r.skip(i,o,o+l),t-=l,o+=l}else break;return this.tile=i,this.index=o,this.beforeBreak=s,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class Wje{constructor(t,n,r,i){this.from=t,this.to=n,this.wrapper=r,this.rank=i}}class Uje{constructor(t,n,r){this.cache=t,this.root=n,this.blockWrappers=r,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(t,n,r,i){var o;this.flushBuffer();let s=this.ensureMarks(n,r),a=s.lastChild;if(a&&a.isText()&&!(a.flags&8)&&a.length+t.length<512){this.cache.reused.set(a,2);let l=s.children[s.children.length-1]=new Pa(a.dom,a.text+t);l.parent=s}else s.append(i||Pa.of(t,(o=this.cache.find(Pa))===null||o===void 0?void 0:o.dom));this.pos+=t.length,this.afterWidget=null}addComposition(t,n){let r=this.curLine;r.dom!=n.line.dom&&(r.setDOM(this.cache.reused.has(n.line)?u1(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let i=r;for(let a=n.marks.length-1;a>=0;a--){let l=n.marks[a],u=i.lastChild;if(u instanceof Un&&u.mark.eq(l.mark))u.dom!=l.dom&&u.setDOM(u1(l.dom)),i=u;else{if(this.cache.reused.get(l)){let f=Pt.get(l.dom);f&&f.setDOM(u1(l.dom))}let c=Un.of(l.mark,l.dom);i.append(c),i=c}this.cache.reused.set(l,2)}let o=Pt.get(t.text);o&&this.cache.reused.set(o,2);let s=new Pa(t.text,t.text.nodeValue);s.flags|=8,i.append(s)}addInlineWidget(t,n,r){let i=this.afterWidget&&t.flags&48&&(this.afterWidget.flags&48)==(t.flags&48);i||this.flushBuffer();let o=this.ensureMarks(n,r);!i&&!(t.flags&16)&&o.append(this.getBuffer(1)),o.append(t),this.pos+=t.length,this.afterWidget=t}addMark(t,n,r){this.flushBuffer(),this.ensureMarks(n,r).append(t),this.pos+=t.length,this.afterWidget=null}addBlockWidget(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}continueWidget(t){let n=this.afterWidget||this.lastBlock;n.length+=t,this.pos+=t}addLineStart(t,n){var r;t||(t=J6);let i=gc.start(t,n||((r=this.cache.find(gc))===null||r===void 0?void 0:r.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=i)}addLine(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(t){this.blockPosCovered()||this.addLineStart(t)}ensureLine(t){this.curLine||this.addLineStart(t)}ensureMarks(t,n){var r;let i=this.curLine;for(let o=t.length-1;o>=0;o--){let s=t[o],a;if(n>0&&(a=i.lastChild)&&a instanceof Un&&a.mark.eq(s))i=a,n--;else{let l=Un.of(s,(r=this.cache.find(Un,u=>u.mark.eq(s)))===null||r===void 0?void 0:r.dom);i.append(l),i=l,n=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let t=this.curLine.lastChild;(!t||!JN(this.curLine,!1)||t.dom.nodeName!="BR"&&t.isWidget()&&!(oe.ios&&JN(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(c1,0,32)||new il(c1.toDOM(),0,c1,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let t=this.wrappers.length-1;t>=0;t--)this.wrappers[t].to<this.pos&&this.wrappers.splice(t,1);for(let t=this.blockWrappers;t.value&&t.from<=this.pos;t.next())if(t.to>=this.pos){let n=new Wje(t.from,t.to,t.value,t.rank),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to)<0;)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){var t;this.updateBlockWrappers();let n=this.root;for(let r of this.wrappers){let i=n.lastChild;if(r.from<this.pos&&i instanceof Oo&&i.wrapper.eq(r.wrapper))n=i;else{let o=Oo.of(r.wrapper,(t=this.cache.find(Oo,s=>s.wrapper.eq(r.wrapper)))===null||t===void 0?void 0:t.dom);n.append(o),n=o}}return n}blockPosCovered(){let t=this.lastBlock;return t!=null&&!t.breakAfter&&(!t.isWidget()||(t.flags&160)>0)}getBuffer(t){let n=2|(t<0?16:32),r=this.cache.find(av,void 0,1);return r&&(r.flags=n),r||new av(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class Hje{constructor(t){this.skipCount=0,this.text="",this.textOff=0,this.cursor=t.iter()}skip(t){this.textOff+t<=this.text.length?this.textOff+=t:(this.skipCount+=t-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(t){if(this.textOff==this.text.length){let{value:i,lineBreak:o,done:s}=this.cursor.next(this.skipCount);if(this.skipCount=0,s)throw new Error("Ran out of text content when drawing inline views");this.text=i;let a=this.textOff=Math.min(t,i.length);return o?null:i.slice(0,a)}let n=Math.min(this.text.length,this.textOff+t),r=this.text.slice(this.textOff,n);return this.textOff=n,r}}const lv=[il,gc,Pa,Un,av,Oo,ub];for(let e=0;e<lv.length;e++)lv[e].bucket=e;class Vje{constructor(t){this.view=t,this.buckets=lv.map(()=>[]),this.index=lv.map(()=>0),this.reused=new Map}add(t){let n=t.constructor.bucket,r=this.buckets[n];r.length<6?r.push(t):r[this.index[n]=(this.index[n]+1)%6]=t}find(t,n,r=2){let i=t.bucket,o=this.buckets[i],s=this.index[i];for(let a=o.length-1;a>=0;a--){let l=(a+s)%o.length,u=o[l];if((!n||n(u))&&!this.reused.has(u))return o.splice(l,1),l<s&&this.index[i]--,this.reused.set(u,r),u}return null}findWidget(t,n,r){let i=this.buckets[0];if(i.length)for(let o=0,s=0;;o++){if(o==i.length){if(s)return null;s=1,o=0}let a=i[o];if(!this.reused.has(a)&&(s==0?a.widget.compare(t):a.widget.constructor==t.constructor&&t.updateDOM(a.dom,this.view,a.widget)))return i.splice(o,1),o<this.index[0]&&this.index[0]--,a.widget==t&&a.length==n&&(a.flags&497)==r?(this.reused.set(a,1),a):(this.reused.set(a,2),new il(a.dom,n,t,a.flags&-498|r))}}reuse(t){return this.reused.set(t,1),t}maybeReuse(t,n=2){if(!this.reused.has(t))return this.reused.set(t,n),t.dom}clear(){for(let t=0;t<this.buckets.length;t++)this.buckets[t].length=this.index[t]=0}}class qje{constructor(t,n,r,i,o){this.view=t,this.decorations=i,this.disallowBlockEffectsFor=o,this.openWidget=!1,this.openMarks=0,this.cache=new Vje(t),this.text=new Hje(t.state.doc),this.builder=new Uje(this.cache,new ub(t,t.contentDOM),_e.iter(r)),this.cache.reused.set(n,2),this.old=new zje(n),this.reuseWalker={skip:(s,a,l)=>{if(this.cache.add(s),s.isComposite())return!1},enter:s=>this.cache.add(s),leave:()=>{},break:()=>{}}}run(t,n){let r=n&&this.getCompositionContext(n.text);for(let i=0,o=0,s=0;;){let a=s<t.length?t[s++]:null,l=a?a.fromA:this.old.root.length;if(l>i){let u=l-i;this.preserve(u,!s,!a),i=l,o+=u}if(!a)break;n&&a.fromA<=n.range.fromA&&a.toA>=n.range.toA?(this.forward(a.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(o,n.range.fromB),this.cache.clear(),this.builder.addComposition(n,r),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,a.toA),this.emit(n.range.toB,a.toB)):(this.forward(a.fromA,a.toA),this.emit(o,a.toB)),o=a.toB,i=a.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(t,n,r){let i=Qje(this.old),o=this.openMarks;this.old.advance(t,r?1:-1,{skip:(s,a,l)=>{if(s.isWidget())if(this.openWidget)this.builder.continueWidget(l-a);else{let u=l>0||a<s.length?il.of(s.widget,this.view,l-a,s.flags&496,this.cache.maybeReuse(s)):this.cache.reuse(s);u.flags&256?(u.flags&=-2,this.builder.addBlockWidget(u)):(this.builder.ensureLine(null),this.builder.addInlineWidget(u,i,o),o=i.length)}else if(s.isText())this.builder.ensureLine(null),!a&&l==s.length&&!this.cache.reused.has(s)?this.builder.addText(s.text,i,o,this.cache.reuse(s)):(this.cache.add(s),this.builder.addText(s.text.slice(a,l),i,o)),o=i.length;else if(s.isLine())s.flags&=-2,this.cache.reused.set(s,1),this.builder.addLine(s);else if(s instanceof av)this.cache.add(s);else if(s instanceof Un)this.builder.ensureLine(null),this.builder.addMark(s,i,o),this.cache.reused.set(s,1),o=i.length;else return!1;this.openWidget=!1},enter:s=>{s.isLine()?this.builder.addLineStart(s.attrs,this.cache.maybeReuse(s)):(this.cache.add(s),s instanceof Un&&i.unshift(s.mark)),this.openWidget=!1},leave:s=>{s.isLine()?i.length&&(i.length=o=0):s instanceof Un&&(i.shift(),o=Math.min(o,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(t)}emit(t,n){let r=null,i=this.builder,o=0,s=_e.spans(this.decorations,t,n,{point:(a,l,u,c,f,h)=>{if(u instanceof nl){if(this.disallowBlockEffectsFor[h]){if(u.block)throw new RangeError("Block decorations may not be specified via plugins");if(l>this.view.state.doc.lineAt(a).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(o=c.length,f>c.length)i.continueWidget(l-a);else{let d=u.widget||(u.block?yc.block:yc.inline),p=Kje(u),m=this.cache.findWidget(d,l-a,p)||il.of(d,this.view,l-a,p);u.block?(u.startSide>0&&i.addLineStartIfNotCovered(r),i.addBlockWidget(m)):(i.ensureLine(r),i.addInlineWidget(m,c,f))}r=null}else r=Gje(r,u);l>a&&this.text.skip(l-a)},span:(a,l,u,c)=>{for(let f=a;f<l;){let h=this.text.next(Math.min(512,l-f));h==null?(i.addLineStartIfNotCovered(r),i.addBreak(),f++):(i.ensureLine(r),i.addText(h,u,f==a?c:u.length),f+=h.length),r=null}}});i.addLineStartIfNotCovered(r),this.openWidget=s>o,this.openMarks=s}forward(t,n,r=1){n-t<=10?this.old.advance(n-t,r,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-t-10,-1),this.old.advance(5,r,this.reuseWalker))}getCompositionContext(t){let n=[],r=null;for(let i=t.parentNode;;i=i.parentNode){let o=Pt.get(i);if(i==this.view.contentDOM)break;o instanceof Un?n.push(o):o?.isLine()?r=o:o instanceof Oo||(i.nodeName=="DIV"&&!r&&i!=this.view.contentDOM?r=new gc(i,J6):r||n.push(Un.of(new up({tagName:i.nodeName.toLowerCase(),attributes:wje(i)}),i)))}return{line:r,marks:n}}}function JN(e,t){let n=r=>{for(let i of r.children)if((t?i.isText():i.length)||n(i))return!0;return!1};return n(e)}function Kje(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}const J6={class:"cm-line"};function Gje(e,t){let n=t.spec.attributes,r=t.spec.class;return!n&&!r||(e||(e={class:"cm-line"}),n&&IP(n,e),r&&(e.class+=" "+r)),e}function Qje(e){let t=[];for(let n=e.parents.length;n>1;n--){let r=n==e.parents.length?e.tile:e.parents[n].tile;r instanceof Un&&t.push(r.mark)}return t}function u1(e){let t=Pt.get(e);return t&&t.setDOM(e.cloneNode()),e}class yc extends eo{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}yc.inline=new yc("span");yc.block=new yc("div");const c1=new class extends eo{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class eR{constructor(t){this.view=t,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=de.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new ub(t,t.contentDOM),this.updateInner([new zr(0,0,0,t.state.doc.length)],null)}update(t){var n;let r=t.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:c,toA:f})=>f<this.minWidthFrom||c>this.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!iMe(t.changes,this.hasComposition)&&!t.selectionSet&&(i=t.state.selection.main.head));let o=i>-1?Yje(this.view,t.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:c,to:f}=this.hasComposition;r=new zr(c,f,t.changes.mapPos(c,-1),t.changes.mapPos(f,1)).addToSet(r.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(oe.ie||oe.chrome)&&!o&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,a=this.blockWrappers;this.updateDeco();let l=eMe(s,this.decorations,t.changes);l.length&&(r=zr.extendWithRanges(r,l));let u=nMe(a,this.blockWrappers,t.changes);return u.length&&(r=zr.extendWithRanges(r,u)),o&&!r.some(c=>c.fromA<=o.range.fromA&&c.toA>=o.range.toA)&&(r=o.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,o),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,n){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(n||t.length){let s=this.tile,a=new qje(this.view,s,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&Pt.get(n.text)&&a.cache.reused.set(Pt.get(n.text),2),this.tile=a.run(t,n),fO(s,a.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=oe.chrome||oe.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(o),o&&(o.written||r.selectionRange.focusNode!=o.node||!this.tile.dom.contains(o.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let o of this.tile.children)o.isWidget()&&o.widget instanceof f1&&i.push(o.dom);r.updateGaps(i)}updateEditContextFormatting(t){this.editContextFormatting=this.editContextFormatting.map(t.changes);for(let n of t.transactions)for(let r of n.effects)r.is(G6)&&(this.editContextFormatting=r.value)}updateSelection(t=!1,n=!1){(t||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,i=this.view.root.activeElement,o=i==r,s=!o&&!(this.view.state.facet(co)||r.tabIndex>-1)&&uh(r,this.view.observer.selectionRange)&&!(i&&r.contains(i));if(!(o||n||s))return;let a=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,u,c;if(l.empty?c=u=this.inlineDOMNearPos(l.anchor,l.assoc||1):(c=this.inlineDOMNearPos(l.head,l.head==l.from?1:-1),u=this.inlineDOMNearPos(l.anchor,l.anchor==l.from?1:-1)),oe.gecko&&l.empty&&!this.hasComposition&&Xje(u)){let h=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(h,u.node.childNodes[u.offset]||null)),u=c=new fi(h,0),a=!0}let f=this.view.observer.selectionRange;(a||!f.focusNode||(!fh(u.node,u.offset,f.anchorNode,f.anchorOffset)||!fh(c.node,c.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,l))&&(this.view.observer.ignore(()=>{oe.android&&oe.chrome&&r.contains(f.focusNode)&&rMe(f.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let h=Md(this.view.root);if(h)if(l.empty){if(oe.gecko){let d=Zje(u.node,u.offset);if(d&&d!=3){let p=(d==1?M6:I6)(u.node,u.offset);p&&(u=new fi(p.node,p.offset))}}h.collapse(u.node,u.offset),l.bidiLevel!=null&&h.caretBidiLevel!==void 0&&(h.caretBidiLevel=l.bidiLevel)}else if(h.extend){h.collapse(u.node,u.offset);try{h.extend(c.node,c.offset)}catch{}}else{let d=document.createRange();l.anchor>l.head&&([u,c]=[c,u]),d.setEnd(c.node,c.offset),d.setStart(u.node,u.offset),h.removeAllRanges(),h.addRange(d)}s&&this.view.root.activeElement==r&&(r.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(u,c)),this.impreciseAnchor=u.precise?null:new fi(f.anchorNode,f.anchorOffset),this.impreciseHead=c.precise?null:new fi(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(t,n){return this.hasComposition&&n.empty&&fh(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,n=t.state.selection.main,r=Md(t.root),{anchorNode:i,anchorOffset:o}=t.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let s=this.lineAt(n.head,n.assoc);if(!s)return;let a=s.posAtStart;if(n.head==a||n.head==a+s.length)return;let l=this.coordsAt(n.head,-1),u=this.coordsAt(n.head,1);if(!l||!u||l.bottom>u.top)return;let c=this.domAtPos(n.head+n.assoc,n.assoc);r.collapse(c.node,c.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let f=t.observer.selectionRange;t.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&r.collapse(i,o)}posFromDOM(t,n){let r=this.tile.nearest(t);if(!r)return this.tile.dom.compareDocumentPosition(t)&2?0:this.view.state.doc.length;let i=r.posAtStart;if(r.isComposite()){let o;if(t==r.dom)o=r.dom.childNodes[n];else{let s=No(t)==0?0:n==0?-1:1;for(;;){let a=t.parentNode;if(a==r.dom)break;s==0&&a.firstChild!=a.lastChild&&(t==a.firstChild?s=-1:s=1),t=a}s<0?o=t:o=t.nextSibling}if(o==r.dom.firstChild)return i;for(;o&&!Pt.get(o);)o=o.nextSibling;if(!o)return i+r.length;for(let s=0,a=i;;s++){let l=r.children[s];if(l.dom==o)return a;a+=l.length+l.breakAfter}}else return r.isText()?t==r.dom?i+n:i+(n?r.length:0):i}domAtPos(t,n){let{tile:r,offset:i}=this.tile.resolveBlock(t,n);return r.isWidget()?r.domPosFor(t,n):r.domIn(i,n)}inlineDOMNearPos(t,n){let r,i=-1,o=!1,s,a=-1,l=!1;return this.tile.blockTiles((u,c)=>{if(u.isWidget()){if(u.flags&32&&c>=t)return!0;u.flags&16&&(o=!0)}else{let f=c+u.length;if(c<=t&&(r=u,i=t-c,o=f<t),f>=t&&!s&&(s=u,a=t-c,l=c>t),c>t&&s)return!0}}),!r&&!s?this.domAtPos(t,n):(o&&s?r=null:l&&r&&(s=null),r&&n<0||!s?r.domIn(i,n):s.domIn(a,n))}coordsAt(t,n){let{tile:r,offset:i}=this.tile.resolveBlock(t,n);return r.isWidget()?r.widget instanceof f1?null:r.coordsInWidget(i,n,!0):r.coordsIn(i,n)}lineAt(t,n){let{tile:r}=this.tile.resolveBlock(t,n);return r.isLine()?r:null}coordsForChar(t){let{tile:n,offset:r}=this.tile.resolveBlock(t,1);if(!n.isLine())return null;function i(o,s){if(o.isComposite())for(let a of o.children){if(a.length>=s){let l=i(a,s);if(l)return l}if(s-=a.length,s<0)break}else if(o.isText()&&s<o.length){let a=Jt(o.text,s);if(a==s)return null;let l=Nd(o.dom,s,a).getClientRects();for(let u=0;u<l.length;u++){let c=l[u];if(u==l.length-1||c.top<c.bottom&&c.left<c.right)return c}}return null}return i(n,r)}measureVisibleLineHeights(t){let n=[],{from:r,to:i}=t,o=this.view.contentDOM.clientWidth,s=o>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==Je.LTR,u=0,c=(f,h,d)=>{for(let p=0;p<f.children.length&&!(h>i);p++){let m=f.children[p],v=h+m.length,b=m.dom.getBoundingClientRect(),{height:y}=b;if(d&&!p&&(u+=b.top-d.top),m instanceof Oo)v>r&&c(m,h,b);else if(h>=r&&(u>0&&n.push(-u),n.push(y+u),u=0,s)){let x=m.dom.lastChild,k=x?ch(x):[];if(k.length){let w=k[k.length-1],S=l?w.right-b.left:b.right-w.left;S>a&&(a=S,this.minWidth=o,this.minWidthFrom=h,this.minWidthTo=v)}}d&&p==f.children.length-1&&(u+=d.bottom-b.bottom),h=v+m.breakAfter}};return c(this.tile,0,null),n}textDirectionAt(t){let{tile:n}=this.tile.resolveBlock(t,1);return getComputedStyle(n.dom).direction=="rtl"?Je.RTL:Je.LTR}measureTextSize(){let t=this.tile.blockTiles(s=>{if(s.isLine()&&s.children.length&&s.length<=20){let a=0,l;for(let u of s.children){if(!u.isText()||/[^ -~]/.test(u.text))return;let c=ch(u.dom);if(c.length!=1)return;a+=c[0].width,l=c[0].height}if(a)return{lineHeight:s.dom.getBoundingClientRect().height,charWidth:a/s.length,textHeight:l}}});if(t)return t;let n=document.createElement("div"),r,i,o;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let s=ch(n.firstChild)[0];r=n.getBoundingClientRect().height,i=s&&s.width?s.width/27:7,o=s&&s.height?s.height:r,n.remove()}),{lineHeight:r,charWidth:i,textHeight:o}}computeBlockGapDeco(){let t=[],n=this.view.viewState;for(let r=0,i=0;;i++){let o=i==n.viewports.length?null:n.viewports[i],s=o?o.from-1:this.view.state.doc.length;if(s>r){let a=(n.lineBlockAt(s).bottom-n.lineBlockAt(r).top)/this.view.scaleY;t.push(de.replace({widget:new f1(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,s))}if(!o)break;r=o.to+1}return de.set(t)}updateDeco(){let t=1,n=this.view.state.facet(ab).map(o=>(this.dynamicDecorationMap[t++]=typeof o=="function")?o(this.view):o),r=!1,i=this.view.state.facet(BP).map((o,s)=>{let a=typeof o=="function";return a&&(r=!0),a?o(this.view):o});for(i.length&&(this.dynamicDecorationMap[t++]=r,n.push(_e.join(i))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];t<this.decorations.length;)this.dynamicDecorationMap[t++]=!1;this.blockWrappers=this.view.state.facet(X6).map(o=>typeof o=="function"?o(this.view):o)}scrollIntoView(t){var n;if(t.isSnapshot){let c=this.view.viewState.lineBlockAt(t.range.head);this.view.scrollDOM.scrollTop=c.top-t.yMargin,this.view.scrollDOM.scrollLeft=t.xMargin;return}for(let c of this.view.state.facet(K6))try{if(c(this.view,t.range,t))return!0}catch(f){Gn(this.view.state,f,"scroll handler")}let{range:r}=t,i=this.coordsAt(r.head,(n=r.assoc)!==null&&n!==void 0?n:r.empty?0:r.head>r.anchor?-1:1),o;if(!i)return;!r.empty&&(o=this.coordsAt(r.anchor,r.anchor>r.head?-1:1))&&(i={left:Math.min(i.left,o.left),top:Math.min(i.top,o.top),right:Math.max(i.right,o.right),bottom:Math.max(i.bottom,o.bottom)});let s=FP(this.view),a={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:l,offsetHeight:u}=this.view.scrollDOM;if(Oje(this.view.scrollDOM,a,r.head<r.anchor?-1:1,t.x,t.y,Math.max(Math.min(t.xMargin,l),-l),Math.max(Math.min(t.yMargin,u),-u),this.view.textDirection==Je.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let c=this.view.docView.lineAt(r.head,1);c&&c.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(t){let n=r=>r.isWidget()||r.children.some(n);return n(this.tile.resolveBlock(t,1).tile)}destroy(){fO(this.tile)}}function fO(e,t){let n=t?.get(e);if(n!=1){n==null&&e.destroy();for(let r of e.children)fO(r,t)}}function Xje(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable=="false")&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable=="false")}function e9(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=M6(n.focusNode,n.focusOffset),i=I6(n.focusNode,n.focusOffset),o=r||i;if(i&&r&&i.node!=r.node){let a=Pt.get(i.node);if(!a||a.isText()&&a.text!=i.node.nodeValue)o=i;else if(e.docView.lastCompositionAfterCursor){let l=Pt.get(r.node);!l||l.isText()&&l.text!=r.node.nodeValue||(o=i)}}if(e.docView.lastCompositionAfterCursor=o!=r,!o)return null;let s=t-o.offset;return{from:s,to:s+o.node.nodeValue.length,node:o.node}}function Yje(e,t,n){let r=e9(e,n);if(!r)return null;let{node:i,from:o,to:s}=r,a=i.nodeValue;if(/[\n\r]/.test(a)||e.state.doc.sliceString(r.from,r.to)!=a)return null;let l=t.invertedDesc;return{range:new zr(l.mapPos(o),l.mapPos(s),o,s),text:i}}function Zje(e,t){return e.nodeType!=1?0:(t&&e.childNodes[t-1].contentEditable=="false"?1:0)|(t<e.childNodes.length&&e.childNodes[t].contentEditable=="false"?2:0)}let Jje=class{constructor(){this.changes=[]}compareRange(t,n){Au(t,n,this.changes)}comparePoint(t,n){Au(t,n,this.changes)}boundChange(t){Au(t,t,this.changes)}};function eMe(e,t,n){let r=new Jje;return _e.compare(e,t,n,r),r.changes}class tMe{constructor(){this.changes=[]}compareRange(t,n){Au(t,n,this.changes)}comparePoint(){}boundChange(t){Au(t,t,this.changes)}}function nMe(e,t,n){let r=new tMe;return _e.compare(e,t,n,r),r.changes}function rMe(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function iMe(e,t){let n=!1;return t&&e.iterChangedRanges((r,i)=>{r<t.to&&i>t.from&&(n=!0)}),n}class f1 extends eo{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function oMe(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),o=t-i.from;if(i.length==0)return V.cursor(t);o==0?n=1:o==i.length&&(n=-1);let s=o,a=o;n<0?s=Jt(i.text,o,!1):a=Jt(i.text,o);let l=r(i.text.slice(s,a));for(;s>0;){let u=Jt(i.text,s,!1);if(r(i.text.slice(u,s))!=l)break;s=u}for(;a<i.length;){let u=Jt(i.text,a);if(r(i.text.slice(a,u))!=l)break;a=u}return V.range(s+i.from,a+i.from)}function sMe(e,t,n,r,i){let o=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>e.defaultLineHeight*1.5){let a=e.viewState.heightOracle.textHeight,l=Math.floor((i-n.top-(e.defaultLineHeight-a)*.5)/a);o+=l*e.viewState.heightOracle.lineLength}let s=e.state.sliceDoc(n.from,n.to);return n.from+Jk(s,o,e.state.tabSize)}function hO(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let i;for(let o of r.type){if(o.from>t)break;if(!(o.to<t)){if(o.from<t&&o.to>t)return o;(!i||o.type==fn.Text&&(i.type!=o.type||(n<0?o.from<t:o.to>t)))&&(i=o)}}return i||r}return r}function aMe(e,t,n,r){let i=hO(e,t.head,t.assoc||-1),o=!r||i.type!=fn.Text||!(e.lineWrapping||i.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head);if(o){let s=e.dom.getBoundingClientRect(),a=e.textDirectionAt(i.from),l=e.posAtCoords({x:n==(a==Je.LTR)?s.right-1:s.left+1,y:(o.top+o.bottom)/2});if(l!=null)return V.cursor(l,n?-1:1)}return V.cursor(n?i.to:i.from,n?-1:1)}function tR(e,t,n,r){let i=e.state.doc.lineAt(t.head),o=e.bidiSpans(i),s=e.textDirectionAt(i.from);for(let a=t,l=null;;){let u=Rje(i,o,s,a,n),c=$6;if(!u){if(i.number==(n?e.state.doc.lines:1))return a;c=`
|
|
436
|
-
`,i=e.state.doc.line(i.number+(n?1:-1)),o=e.bidiSpans(i),u=e.visualLineSide(i,!n)}if(l){if(!l(c))return a}else{if(!r)return u;l=r(c)}a=u}}function lMe(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return o=>{let s=r(o);return i==yt.Space&&(i=s),i==s}}function uMe(e,t,n,r){let i=t.head,o=n?1:-1;if(i==(n?e.state.doc.length:0))return V.cursor(i,t.assoc);let s=t.goalColumn,a,l=e.contentDOM.getBoundingClientRect(),u=e.coordsAtPos(i,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),c=e.documentTop;if(u)s==null&&(s=u.left-l.left),a=o<0?u.top:u.bottom;else{let p=e.viewState.lineBlockAt(i);s==null&&(s=Math.min(l.right-l.left,e.defaultCharacterWidth*(i-p.from))),a=(o<0?p.top:p.bottom)+c}let f=l.left+s,h=e.viewState.heightOracle.textHeight>>1,d=r??h;for(let p=0;;p+=h){let m=a+(d+p)*o,v=dO(e,{x:f,y:m},!1,o);if(n?m>l.bottom:m<l.top)return V.cursor(v.pos,v.assoc);let b=e.coordsAtPos(v.pos,v.assoc),y=b?(b.top+b.bottom)/2:0;if(!b||(n?y>a:y<a))return V.cursor(v.pos,v.assoc,void 0,s)}}function hh(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(o,s,a)=>{if(t>o&&t<s){let l=r||n||(t-o<s-t?-1:1);t=l<0?o:s,r=l}});if(!r)return t}}function t9(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],o=null;if(i.empty){let s=hh(e,i.from,0);s!=i.from&&(o=V.cursor(s,-1))}else{let s=hh(e,i.from,-1),a=hh(e,i.to,1);(s!=i.from||a!=i.to)&&(o=V.range(i.from==i.anchor?s:a,i.from==i.head?s:a))}o&&(n||(n=t.ranges.slice()),n[r]=o)}return n?V.create(n,t.mainIndex):t}function h1(e,t,n){let r=hh(e.state.facet(fp).map(i=>i(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:V.cursor(r,r<n.from?1:-1)}class Ri{constructor(t,n){this.pos=t,this.assoc=n}}function dO(e,t,n,r){let i=e.contentDOM.getBoundingClientRect(),o=i.top+e.viewState.paddingTop,{x:s,y:a}=t,l=a-o,u;for(;;){if(l<0)return new Ri(0,1);if(l>e.viewState.docHeight)return new Ri(e.state.doc.length,-1);if(u=e.elementAtHeight(l),r==null)break;if(u.type==fn.Text){if(r<0?u.to<e.viewport.from:u.from>e.viewport.to)break;let h=e.docView.coordsAt(r<0?u.from:u.to,r>0?-1:1);if(h&&(r<0?h.top<=l+o:h.bottom>=l+o))break}let f=e.viewState.heightOracle.textHeight/2;l=r>0?u.bottom+f:u.top-f}if(e.viewport.from>=u.to||e.viewport.to<=u.from){if(n)return null;if(u.type==fn.Text){let f=sMe(e,i,u,s,a);return new Ri(f,f==u.from?1:-1)}}if(u.type!=fn.Text)return l<(u.top+u.bottom)/2?new Ri(u.from,1):new Ri(u.to,-1);let c=e.docView.lineAt(u.from,2);return(!c||c.length!=u.length)&&(c=e.docView.lineAt(u.from,-2)),new cMe(e,s,a,e.textDirectionAt(u.from)).scanTile(c,u.from)}class cMe{constructor(t,n,r,i){this.view=t,this.x=n,this.y=r,this.baseDir=i,this.line=null,this.spans=null}bidiSpansAt(t){return(!this.line||this.line.from>t||this.line.to<t)&&(this.line=this.view.state.doc.lineAt(t),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(t,n){let{line:r,spans:i}=this.bidiSpansAt(t);return i[Li.find(i,t-r.from,-1,n)].level==this.baseDir}dirAt(t,n){let{line:r,spans:i}=this.bidiSpansAt(t);return i[Li.find(i,t-r.from,-1,n)].dir}bidiIn(t,n){let{spans:r,line:i}=this.bidiSpansAt(t);return r.length>1||r.length&&(r[0].level!=this.baseDir||r[0].to+i.from<n)}scan(t,n){let r=0,i=t.length-1,o=new Set,s=this.bidiIn(t[0],t[i]),a,l,u=-1,c=1e9,f;e:for(;r<i;){let d=i-r,p=r+i>>1;t:if(o.has(p)){let v=r+Math.floor(Math.random()*d);for(let b=0;b<d;b++){if(!o.has(v)){p=v;break t}v++,v==i&&(v=r)}break e}o.add(p);let m=n(p);if(m)for(let v=0;v<m.length;v++){let b=m[v],y=0;if(!(b.width==0&&m.length>1)){if(b.bottom<this.y)(!a||a.bottom<b.bottom)&&(a=b),y=1;else if(b.top>this.y)(!l||l.top>b.top)&&(l=b),y=-1;else{let x=b.left>this.x?this.x-b.left:b.right<this.x?this.x-b.right:0,k=Math.abs(x);k<c&&(u=p,c=k,f=b),x&&(y=x<0==(this.baseDir==Je.LTR)?-1:1)}y==-1&&(!s||this.baseDirAt(t[p],1))?i=p:y==1&&(!s||this.baseDirAt(t[p+1],-1))&&(r=p+1)}}}if(!f){let d=a&&(!l||this.y-a.bottom<l.top-this.y)?a:l;return this.y=(d.top+d.bottom)/2,this.scan(t,n)}if(c){let{top:d,bottom:p}=f;if(a&&a.bottom>(d+d+p)/3)return this.y=a.bottom-1,this.scan(t,n);if(l&&l.top<(d+p+p)/3)return this.y=l.top+1,this.scan(t,n)}let h=(s?this.dirAt(t[u],1):this.baseDir)==Je.LTR;return{i:u,after:this.x>(f.left+f.right)/2==h}}scanText(t,n){let r=[];for(let o=0;o<t.length;o=Jt(t.text,o))r.push(n+o);r.push(n+t.length);let i=this.scan(r,o=>{let s=r[o]-n,a=r[o+1]-n;return Nd(t.dom,s,a).getClientRects()});return i.after?new Ri(r[i.i+1],-1):new Ri(r[i.i],1)}scanTile(t,n){if(!t.length)return new Ri(n,1);if(t.children.length==1){let a=t.children[0];if(a.isText())return this.scanText(a,n);if(a.isComposite())return this.scanTile(a,n)}let r=[n];for(let a=0,l=n;a<t.children.length;a++)r.push(l+=t.children[a].length);let i=this.scan(r,a=>{let l=t.children[a];return l.flags&48?null:(l.dom.nodeType==1?l.dom:Nd(l.dom,0,l.length)).getClientRects()}),o=t.children[i.i],s=r[i.i];return o.isText()?this.scanText(o,s):o.isComposite()?this.scanTile(o,s):i.after?new Ri(r[i.i+1],-1):new Ri(s,1)}}const $l="";class fMe{constructor(t,n){this.points=t,this.view=n,this.text="",this.lineSeparator=n.state.facet(Ne.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=$l}readRange(t,n){if(!t)return this;let r=t.parentNode;for(let i=t;;){this.findPointBefore(r,i);let o=this.text.length;this.readNode(i);let s=Pt.get(i),a=i.nextSibling;if(a==n){s?.breakAfter&&!a&&r!=this.view.contentDOM&&this.lineBreak();break}let l=Pt.get(a);(s&&l?s.breakAfter:(s?s.breakAfter:ov(i))||ov(a)&&(i.nodeName!="BR"||s?.isWidget())&&this.text.length>o)&&!dMe(a,n)&&this.lineBreak(),i=a}return this.findPointBefore(r,n),this}readTextNode(t){let n=t.nodeValue;for(let r of this.points)r.node==t&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let o=-1,s=1,a;if(this.lineSeparator?(o=n.indexOf(this.lineSeparator,r),s=this.lineSeparator.length):(a=i.exec(n))&&(o=a.index,s=a[0].length),this.append(n.slice(r,o<0?n.length:o)),o<0)break;if(this.lineBreak(),s>1)for(let l of this.points)l.node==t&&l.pos>this.text.length&&(l.pos-=s-1);r=o+s}}readNode(t){let n=Pt.get(t),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(t,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,n){for(let r of this.points)r.node==t&&t.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(t,n){for(let r of this.points)(t.nodeType==3?r.node==t:t.contains(r.node))&&(r.pos=this.text.length+(hMe(t,r.node,r.offset)?n:0))}}function hMe(e,t,n){for(;;){if(!t||n<No(t))return!1;if(t==e)return!0;n=Ns(t)+1,t=t.parentNode}}function dMe(e,t){let n;for(;!(e==t||!e);e=e.nextSibling){let r=Pt.get(e);if(!r?.isWidget())return!1;r&&(n||(n=[])).push(r)}if(n)for(let r of n){let i=r.overrideDOMText;if(i?.length)return!1}return!0}class nR{constructor(t,n){this.node=t,this.offset=n,this.pos=-1}}class pMe{constructor(t,n,r,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:o,impreciseAnchor:s}=t.docView,a=t.state.selection;if(t.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=n9(t.docView.tile,n,r,0))){let l=o||s?[]:gMe(t),u=new fMe(l,t);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=yMe(l,this.bounds.from)}else{let l=t.observer.selectionRange,u=o&&o.node==l.focusNode&&o.offset==l.focusOffset||!sO(t.contentDOM,l.focusNode)?a.main.head:t.docView.posFromDOM(l.focusNode,l.focusOffset),c=s&&s.node==l.anchorNode&&s.offset==l.anchorOffset||!sO(t.contentDOM,l.anchorNode)?a.main.anchor:t.docView.posFromDOM(l.anchorNode,l.anchorOffset),f=t.viewport;if((oe.ios||oe.chrome)&&a.main.empty&&u!=c&&(f.from>0||f.to<t.state.doc.length)){let h=Math.min(u,c),d=Math.max(u,c),p=f.from-h,m=f.to-d;(p==0||p==1||h==0)&&(m==0||m==-1||d==t.state.doc.length)&&(u=0,c=t.state.doc.length)}if(t.inputState.composing>-1&&a.ranges.length>1)this.newSel=a.replaceRange(V.range(c,u));else if(t.lineWrapping&&c==u&&!(a.main.empty&&a.main.head==u)&&t.inputState.lastTouchTime>Date.now()-100){let h=t.coordsAtPos(u,-1),d=0;h&&(d=t.inputState.lastTouchY<=h.bottom?-1:1),this.newSel=V.create([V.cursor(u,d)])}else this.newSel=V.single(c,u)}}}function n9(e,t,n,r){if(e.isComposite()){let i=-1,o=-1,s=-1,a=-1;for(let l=0,u=r,c=r;l<e.children.length;l++){let f=e.children[l],h=u+f.length;if(u<t&&h>n)return n9(f,t,n,u);if(h>=t&&i==-1&&(i=l,o=u),u>n&&f.dom.parentNode==e.dom){s=l,a=c;break}c=h,u=h+f.breakAfter}return{from:o,to:a<0?r+e.length:a,startDOM:(i?e.children[i-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:s<e.children.length&&s>=0?e.children[s].dom:null}}else return e.isText()?{from:r,to:r+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function r9(e,t){let n,{newSel:r}=t,{state:i}=e,o=i.selection.main,s=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:a,to:l}=t.bounds,u=o.from,c=null;(s===8||oe.android&&t.text.length<l-a)&&(u=o.to,c="end");let f=i.doc.sliceString(a,l,$l),h,d;!o.empty&&o.from>=a&&o.to<=l&&(t.typeOver||f!=t.text)&&f.slice(0,o.from-a)==t.text.slice(0,o.from-a)&&f.slice(o.to-a)==t.text.slice(h=t.text.length-(f.length-(o.to-a)))?n={from:o.from,to:o.to,insert:Re.of(t.text.slice(o.from-a,h).split($l))}:(d=i9(f,t.text,u-a,c))&&(oe.chrome&&s==13&&d.toB==d.from+2&&t.text.slice(d.from,d.toB)==$l+$l&&d.toB--,n={from:a+d.from,to:a+d.toA,insert:Re.of(t.text.slice(d.from,d.toB).split($l))})}else r&&(!e.hasFocus&&i.facet(co)||uv(r,o))&&(r=null);if(!n&&!r)return!1;if((oe.mac||oe.android)&&n&&n.from==n.to&&n.from==o.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=V.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:Re.of([n.insert.toString().replace("."," ")])}):i.doc.lineAt(o.from).to<o.to&&e.docView.lineHasWidget(o.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:o.from,to:o.to,insert:i.toText(e.inputState.insertingText)}:oe.chrome&&n&&n.from==n.to&&n.from==o.head&&n.insert.toString()==`
|
|
437
|
-
`&&e.lineWrapping&&(r&&(r=V.single(r.main.anchor-1,r.main.head-1)),n={from:o.from,to:o.to,insert:Re.of([" "])}),n)return zP(e,n,r,s);if(r&&!uv(r,o)){let a=!1,l="select";return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin=="select"&&(a=!0),l=e.inputState.lastSelectionOrigin,l=="select.pointer"&&(r=t9(i.facet(fp).map(u=>u(e)),r))),e.dispatch({selection:r,scrollIntoView:a,userEvent:l}),!0}else return!1}function zP(e,t,n,r=-1){if(oe.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(oe.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&e.state.sliceDoc(t.from,i.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&Pu(e.contentDOM,"Enter",13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.length<t.to-t.from&&t.to>i.head)&&Pu(e.contentDOM,"Backspace",8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&Pu(e.contentDOM,"Delete",46)))return!0;let o=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let s,a=()=>s||(s=mMe(e,t,n));return e.state.facet(U6).some(l=>l(e,t.from,t.to,o,a))||e.dispatch(a()),!0}function mMe(e,t,n){let r,i=e.state,o=i.selection.main,s=-1;if(t.from==t.to&&t.from<o.from||t.from>o.to){let l=t.from<o.from?-1:1,u=l<0?o.from:o.to,c=hh(i.facet(fp).map(f=>f(e)),u,l);t.from==c&&(s=c)}if(s>-1)r={changes:t,selection:V.cursor(t.from+t.insert.length,-1)};else if(t.from>=o.from&&t.to<=o.to&&t.to-t.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let l=o.from<t.from?i.sliceDoc(o.from,t.from):"",u=o.to>t.to?i.sliceDoc(t.to,o.to):"";r=i.replaceSelection(e.state.toText(l+t.insert.sliceString(0,void 0,e.state.lineBreak)+u))}else{let l=i.changes(t),u=n&&n.main.to<=l.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=o.to+10&&t.to>=o.to-10){let c=e.state.sliceDoc(t.from,t.to),f,h=n&&e9(e,n.main.head);if(h){let p=t.insert.length-(t.to-t.from);f={from:h.from,to:h.to-p}}else f=e.state.doc.lineAt(o.head);let d=o.to-t.to;r=i.changeByRange(p=>{if(p.from==o.from&&p.to==o.to)return{changes:l,range:u||p.map(l)};let m=p.to-d,v=m-c.length;if(e.state.sliceDoc(v,m)!=c||m>=f.from&&v<=f.to)return{range:p};let b=i.changes({from:v,to:m,insert:t.insert}),y=p.to-o.to;return{changes:b,range:u?V.range(Math.max(0,u.anchor+y),Math.max(0,u.head+y)):p.map(b)}})}else r={changes:l,selection:u&&i.selection.replaceRange(u)}}let a="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,a+=".compose",e.inputState.compositionFirstChange&&(a+=".start",e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:a,scrollIntoView:!0})}function i9(e,t,n,r){let i=Math.min(e.length,t.length),o=0;for(;o<i&&e.charCodeAt(o)==t.charCodeAt(o);)o++;if(o==i&&e.length==t.length)return null;let s=e.length,a=t.length;for(;s>0&&a>0&&e.charCodeAt(s-1)==t.charCodeAt(a-1);)s--,a--;if(r=="end"){let l=Math.max(0,o-Math.min(s,a));n-=s+l-o}if(s<o&&e.length<t.length){let l=n<=o&&n>=s?o-n:0;o-=l,a=o+(a-s),s=o}else if(a<o){let l=n<=o&&n>=a?o-n:0;o-=l,s=o+(s-a),a=o}return{from:o,toA:s,toB:a}}function gMe(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}=e.observer.selectionRange;return n&&(t.push(new nR(n,r)),(i!=n||o!=r)&&t.push(new nR(i,o))),t}function yMe(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n>-1&&r>-1?V.single(n+t,r+t):null}function uv(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class vMe{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,oe.safari&&t.contentDOM.addEventListener("input",()=>null),oe.gecko&&IMe(t.contentDOM.ownerDocument)}handleEvent(t){!AMe(this.view,t)||this.ignoreDuringComposition(t)||t.type=="keydown"&&this.keydown(t)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(t.type,t)):this.runHandlers(t.type,t))}runHandlers(t,n){let r=this.handlers[t];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(t){let n=bMe(t),r=this.handlers,i=this.view.contentDOM;for(let o in n)if(o!="scroll"){let s=!n[o].handlers.length,a=r[o];a&&s!=!a.handlers.length&&(i.removeEventListener(o,this.handleEvent),a=null),a||i.addEventListener(o,this.handleEvent,{passive:s})}for(let o in r)o!="scroll"&&!n[o]&&i.removeEventListener(o,this.handleEvent);this.handlers=n}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&t.keyCode!=27&&s9.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),oe.android&&oe.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;let n;return oe.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&!t.shiftKey&&((n=o9.find(r=>r.keyCode==t.keyCode))&&!t.ctrlKey||xMe.indexOf(t.key)>-1&&t.ctrlKey)?(this.pendingIOSKey=n||t,setTimeout(()=>this.flushIOSKey(),250),!0):(t.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(t){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&t&&t.from<t.to&&/^\S+$/.test(t.insert.toString())?!1:(this.pendingIOSKey=void 0,Pu(this.view.contentDOM,n.key,n.keyCode,n instanceof KeyboardEvent?n:void 0))}ignoreDuringComposition(t){return!/^key/.test(t.type)||t.synthetic?!1:this.composing>0?!0:oe.safari&&!oe.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function rR(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(i){Gn(n.state,i)}}}function bMe(e){let t=Object.create(null);function n(r){return t[r]||(t[r]={observers:[],handlers:[]})}for(let r of e){let i=r.spec,o=i&&i.plugin.domEventHandlers,s=i&&i.plugin.domEventObservers;if(o)for(let a in o){let l=o[a];l&&n(a).handlers.push(rR(r.value,l))}if(s)for(let a in s){let l=s[a];l&&n(a).observers.push(rR(r.value,l))}}for(let r in gi)n(r).handlers.push(gi[r]);for(let r in tr)n(r).observers.push(tr[r]);return t}const o9=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],xMe="dthko",s9=[16,17,18,20,91,92,224,225],hm=6;function dm(e){return Math.max(0,e)*.7+8}function wMe(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}class SMe{constructor(t,n,r,i){this.view=t,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=T6(t.contentDOM),this.atoms=t.state.facet(fp).map(s=>s(t));let o=t.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=t.state.facet(Ne.allowMultipleSelections)&&kMe(t,n),this.dragging=CMe(t,n)&&u9(n)==1?null:!1}start(t){this.dragging===!1&&this.select(t)}move(t){if(t.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&wMe(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let n=0,r=0,i=0,o=0,s=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:s}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=FP(this.view);t.clientX-l.left<=i+hm?n=-dm(i-t.clientX):t.clientX+l.right>=s-hm&&(n=dm(t.clientX-s)),t.clientY-l.top<=o+hm?r=-dm(o-t.clientY):t.clientY+l.bottom>=a-hm&&(r=dm(t.clientY-a)),this.setScrollSpeed(n,r)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,n){this.scrollSpeed={x:t,y:n},t||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:n}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(t||n)&&this.view.win.scrollBy(t,n),this.dragging===!1&&this.select(this.lastEvent)}select(t){let{view:n}=this,r=t9(this.atoms,this.style.get(t,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){t.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}function kMe(e,t){let n=e.state.facet(B6);return n.length?n[0](t):oe.mac?t.metaKey:t.ctrlKey}function OMe(e,t){let n=e.state.facet(F6);return n.length?n[0](t):oe.mac?!t.altKey:!t.ctrlKey}function CMe(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=Md(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let o=0;o<i.length;o++){let s=i[o];if(s.left<=t.clientX&&s.right>=t.clientX&&s.top<=t.clientY&&s.bottom>=t.clientY)return!0}return!1}function AMe(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Pt.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(t))return!1;return!0}const gi=Object.create(null),tr=Object.create(null),a9=oe.ie&&oe.ie_version<15||oe.ios&&oe.webkit_version<604;function PMe(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),l9(e,n.value)},50)}function cb(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function l9(e,t){t=cb(e.state,DP,t);let{state:n}=e,r,i=1,o=n.toText(t),s=o.lines==n.selection.ranges.length;if(pO!=null&&n.selection.ranges.every(l=>l.empty)&&pO==o.toString()){let l=-1;r=n.changeByRange(u=>{let c=n.doc.lineAt(u.from);if(c.from==l)return{range:u};l=c.from;let f=n.toText((s?o.line(i++).text:t)+n.lineBreak);return{changes:{from:c.from,insert:f},range:V.cursor(u.from+f.length)}})}else s?r=n.changeByRange(l=>{let u=o.line(i++);return{changes:{from:l.from,to:l.to,insert:u.text},range:V.cursor(l.from+u.length)}}):r=n.replaceSelection(o);e.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}tr.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft};tr.wheel=tr.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()};gi.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1);tr.touchstart=(e,t)=>{let n=e.inputState,r=t.targetTouches[0];n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin("select.pointer")};tr.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")};gi.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of e.state.facet(z6))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=TMe(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new SMe(e,t,n,r)),r&&e.observer.ignore(()=>{_6(e.contentDOM);let o=e.root.activeElement;o&&!o.contains(e.contentDOM)&&o.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),i.dragging===!1}else e.inputState.setSelectionOrigin("select.pointer");return!1};function iR(e,t,n,r){if(r==1)return V.cursor(t,n);if(r==2)return oMe(e.state,t,n);{let i=e.docView.lineAt(t,n),o=e.state.doc.lineAt(i?i.posAtEnd:t),s=i?i.posAtStart:o.from,a=i?i.posAtEnd:o.to;return a<e.state.doc.length&&a==o.to&&a++,V.range(s,a)}}const EMe=oe.ie&&oe.ie_version<=11;let oR=null,sR=0,aR=0;function u9(e){if(!EMe)return e.detail;let t=oR,n=aR;return oR=e,aR=Date.now(),sR=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(sR+1)%3:1}function TMe(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),r=u9(t),i=e.state.selection;return{update(o){o.docChanged&&(n.pos=o.changes.mapPos(n.pos),i=i.map(o.changes))},get(o,s,a){let l=e.posAndSideAtCoords({x:o.clientX,y:o.clientY},!1),u,c=iR(e,l.pos,l.assoc,r);if(n.pos!=l.pos&&!s){let f=iR(e,n.pos,n.assoc,r),h=Math.min(f.from,c.from),d=Math.max(f.to,c.to);c=h<c.from?V.range(h,d,c.assoc):V.range(d,h,c.assoc)}return s?i.replaceRange(i.main.extend(c.from,c.to,c.assoc)):a&&r==1&&i.ranges.length>1&&(u=_Me(i,l.pos))?u:a?i.addRange(c):V.create([c])}}}function _Me(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return V.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}gi.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let i=e.docView.tile.nearest(t.target);if(i&&i.isWidget()){let o=i.posAtStart,s=o+i.length;(o>=n.to||s<=n.from)&&(n=V.range(o,s))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",cb(e.state,LP,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1};gi.dragend=e=>(e.inputState.draggedContent=null,!1);function lR(e,t,n,r){if(n=cb(e.state,DP,n),!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:o}=e.inputState,s=r&&o&&OMe(e,t)?{from:o.from,to:o.to}:null,a={from:i,insert:n},l=e.state.changes(s?[s,a]:a);e.focus(),e.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:s?"move.drop":"input.drop"}),e.inputState.draggedContent=null}gi.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,o=()=>{++i==n.length&&lR(e,t,r.filter(s=>s!=null).join(e.state.lineBreak),!1)};for(let s=0;s<n.length;s++){let a=new FileReader;a.onerror=o,a.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[s]=a.result),o()},a.readAsText(n[s])}return!0}else{let r=t.dataTransfer.getData("Text");if(r)return lR(e,t,r,!0),!0}return!1};gi.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=a9?null:t.clipboardData;return n?(l9(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(PMe(e),!1)};function jMe(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}function MMe(e){let t=[],n=[],r=!1;for(let i of e.selection.ranges)i.empty||(t.push(e.sliceDoc(i.from,i.to)),n.push(i));if(!t.length){let i=-1;for(let{from:o}of e.selection.ranges){let s=e.doc.lineAt(o);s.number>i&&(t.push(s.text),n.push({from:s.from,to:Math.min(e.doc.length,s.to+1)})),i=s.number}r=!0}return{text:cb(e,LP,t.join(e.lineBreak)),ranges:n,linewise:r}}let pO=null;gi.copy=gi.cut=(e,t)=>{if(!uh(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=MMe(e.state);if(!n&&!i)return!1;pO=i?n:null,t.type=="cut"&&!e.state.readOnly&&e.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let o=a9?null:t.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(jMe(e,n),!1)};const c9=Zi.define();function f9(e,t){let n=[];for(let r of e.facet(H6)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:c9.of(!0)}):null}function h9(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=f9(e.state,t);n?e.dispatch(n):e.update([])}},10)}tr.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),h9(e)};tr.blur=e=>{e.observer.clearSelectionRange(),h9(e)};tr.compositionstart=tr.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange==null&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))};tr.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,oe.chrome&&oe.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))};tr.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()};gi.beforeinput=(e,t)=>{var n,r;if((t.inputType=="insertText"||t.inputType=="insertCompositionText")&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType=="insertReplacementText"&&e.observer.editContext){let o=(n=t.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),s=t.getTargetRanges();if(o&&s.length){let a=s[0],l=e.posAtDOM(a.startContainer,a.startOffset),u=e.posAtDOM(a.endContainer,a.endOffset);return zP(e,{from:l,to:u,insert:e.state.toText(o)},null),!0}}let i;if(oe.chrome&&oe.android&&(i=o9.find(o=>o.inputType==t.inputType))&&(e.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let o=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var s;(((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0)>o+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return oe.ios&&t.inputType=="deleteContentForward"&&e.observer.flushSoon(),oe.safari&&t.inputType=="insertText"&&e.inputState.composing>=0&&setTimeout(()=>tr.compositionend(e,t),20),!1};const uR=new Set;function IMe(e){uR.has(e)||(uR.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}const cR=["pre-wrap","normal","pre-line","break-spaces"];let vc=!1;function fR(){vc=!1}class NMe{constructor(t){this.lineWrapping=t,this.doc=Re.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-t-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return cR.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let n=!1;for(let r=0;r<t.length;r++){let i=t[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(n=!0,this.heightSamples[Math.floor(i*10)]=!0)}return n}refresh(t,n,r,i,o,s){let a=cR.indexOf(t)>-1,l=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=a||Math.abs(r-this.charWidth)>.1;if(this.lineWrapping=a,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=o,l){this.heightSamples={};for(let u=0;u<s.length;u++){let c=s[u];c<0?u++:this.heightSamples[Math.floor(c*10)]=!0}}return l}}class RMe{constructor(t,n){this.from=t,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class ci{constructor(t,n,r,i,o){this.from=t,this.length=n,this.top=r,this.height=i,this._content=o}get type(){return typeof this._content=="number"?fn.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof nl?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(t){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new ci(this.from,this.length+t.length,this.top,this.height+t.height,n)}}var rt=function(e){return e[e.ByPos=0]="ByPos",e[e.ByHeight=1]="ByHeight",e[e.ByPosNoHeight=2]="ByPosNoHeight",e}(rt||(rt={}));const ng=.001;class Dn{constructor(t,n,r=2){this.length=t,this.height=n,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>ng&&(vc=!0),this.height=t)}replace(t,n,r){return Dn.of(r)}decomposeLeft(t,n){n.push(this)}decomposeRight(t,n){n.push(this)}applyChanges(t,n,r,i){let o=this,s=r.doc;for(let a=i.length-1;a>=0;a--){let{fromA:l,toA:u,fromB:c,toB:f}=i[a],h=o.lineAt(l,rt.ByPosNoHeight,r.setDoc(n),0,0),d=h.to>=u?h:o.lineAt(u,rt.ByPosNoHeight,r,0,0);for(f+=d.to-u,u=d.to;a>0&&h.from<=i[a-1].toA;)l=i[a-1].fromA,c=i[a-1].fromB,a--,l<h.from&&(h=o.lineAt(l,rt.ByPosNoHeight,r,0,0));c+=h.from-l,l=h.from;let p=WP.build(r.setDoc(s),t,c,f);o=cv(o,o.replace(l,u,p))}return o.updateHeight(r,0)}static empty(){return new mr(0,0,0)}static of(t){if(t.length==1)return t[0];let n=0,r=t.length,i=0,o=0;for(;;)if(n==r)if(i>o*2){let a=t[n-1];a.break?t.splice(--n,1,a.left,null,a.right):t.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else if(o>i*2){let a=t[r];a.break?t.splice(r,1,a.left,null,a.right):t.splice(r,1,a.left,a.right),r+=2+a.break,o-=a.size}else break;else if(i<o){let a=t[n++];a&&(i+=a.size)}else{let a=t[--r];a&&(o+=a.size)}let s=0;return t[n-1]==null?(s=1,n--):t[n]==null&&(s=1,r++),new LMe(Dn.of(t.slice(0,n)),s,Dn.of(t.slice(r)))}}function cv(e,t){return e==t?e:(e.constructor!=t.constructor&&(vc=!0),t)}Dn.prototype.size=1;const DMe=de.replace({});class d9 extends Dn{constructor(t,n,r){super(t,n),this.deco=r,this.spaceAbove=0}mainBlock(t,n){return new ci(n,this.length,t+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(t,n,r,i){return this.spaceAbove&&t<r+this.spaceAbove?new ci(i,0,r,this.spaceAbove,DMe):this.mainBlock(r,i)}lineAt(t,n,r,i,o){let s=this.mainBlock(i,o);return this.spaceAbove?this.blockAt(0,r,i,o).join(s):s}forEachLine(t,n,r,i,o,s){t<=o+this.length&&n>=o&&s(this.lineAt(0,rt.ByPos,r,i,o))}setMeasuredHeight(t){let n=t.heights[t.index++];n<0?(this.spaceAbove=-n,n=t.heights[t.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(t,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class mr extends d9{constructor(t,n,r){super(t,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(t,n){return new ci(n,this.length,t+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,r){let i=r[0];return r.length==1&&(i instanceof mr||i instanceof an&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof an?i=new mr(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):Dn.of(r)}updateHeight(t,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setMeasuredHeight(i):(r||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class an extends Dn{constructor(t){super(t,0)}heightMetrics(t,n){let r=t.doc.lineAt(n).number,i=t.doc.lineAt(n+this.length).number,o=i-r+1,s,a=0;if(t.lineWrapping){let l=Math.min(this.height,t.lineHeight*o);s=l/o,this.length>o+1&&(a=(this.height-l)/(this.length-o-1))}else s=this.height/o;return{firstLine:r,lastLine:i,perLine:s,perChar:a}}blockAt(t,n,r,i){let{firstLine:o,lastLine:s,perLine:a,perChar:l}=this.heightMetrics(n,i);if(n.lineWrapping){let u=i+(t<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(t-r)/this.height))*this.length)),c=n.doc.lineAt(u),f=a+c.length*l,h=Math.max(r,t-f/2);return new ci(c.from,c.length,h,f,0)}else{let u=Math.max(0,Math.min(s-o,Math.floor((t-r)/a))),{from:c,length:f}=n.doc.line(o+u);return new ci(c,f,r+a*u,a,0)}}lineAt(t,n,r,i,o){if(n==rt.ByHeight)return this.blockAt(t,r,i,o);if(n==rt.ByPosNoHeight){let{from:d,to:p}=r.doc.lineAt(t);return new ci(d,p-d,0,0,0)}let{firstLine:s,perLine:a,perChar:l}=this.heightMetrics(r,o),u=r.doc.lineAt(t),c=a+u.length*l,f=u.number-s,h=i+a*f+l*(u.from-o-f);return new ci(u.from,u.length,Math.max(i,Math.min(h,i+this.height-c)),c,0)}forEachLine(t,n,r,i,o,s){t=Math.max(t,o),n=Math.min(n,o+this.length);let{firstLine:a,perLine:l,perChar:u}=this.heightMetrics(r,o);for(let c=t,f=i;c<=n;){let h=r.doc.lineAt(c);if(c==t){let p=h.number-a;f+=l*p+u*(t-o-p)}let d=l+u*h.length;s(new ci(h.from,h.length,f,d,0)),f+=d,c=h.to+1}}replace(t,n,r){let i=this.length-n;if(i>0){let o=r[r.length-1];o instanceof an?r[r.length-1]=new an(o.length+i):r.push(null,new an(i-1))}if(t>0){let o=r[0];o instanceof an?r[0]=new an(t+o.length):r.unshift(new an(t-1),null)}return Dn.of(r)}decomposeLeft(t,n){n.push(new an(t-1),null)}decomposeRight(t,n){n.push(null,new an(this.length-t-1))}updateHeight(t,n=0,r=!1,i){let o=n+this.length;if(i&&i.from<=n+this.length&&i.more){let s=[],a=Math.max(n,i.from),l=-1;for(i.from>n&&s.push(new an(i.from-n-1).updateHeight(t,n));a<=o&&i.more;){let c=t.doc.lineAt(a).length;s.length&&s.push(null);let f=i.heights[i.index++],h=0;f<0&&(h=-f,f=i.heights[i.index++]),l==-1?l=f:Math.abs(f-l)>=ng&&(l=-2);let d=new mr(c,f,h);d.outdated=!1,s.push(d),a+=c+1}a<=o&&s.push(null,new an(o-a).updateHeight(t,a));let u=Dn.of(s);return(l<0||Math.abs(u.height-this.height)>=ng||Math.abs(l-this.heightMetrics(t,n).perLine)>=ng)&&(vc=!0),cv(this,u)}else(r||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class LMe extends Dn{constructor(t,n,r){super(t.length+n+r.length,t.height+r.height,n|(t.outdated||r.outdated?2:0)),this.left=t,this.right=r,this.size=t.size+r.size}get break(){return this.flags&1}blockAt(t,n,r,i){let o=r+this.left.height;return t<o?this.left.blockAt(t,n,r,i):this.right.blockAt(t,n,o,i+this.left.length+this.break)}lineAt(t,n,r,i,o){let s=i+this.left.height,a=o+this.left.length+this.break,l=n==rt.ByHeight?t<s:t<a,u=l?this.left.lineAt(t,n,r,i,o):this.right.lineAt(t,n,r,s,a);if(this.break||(l?u.to<a:u.from>a))return u;let c=n==rt.ByPosNoHeight?rt.ByPosNoHeight:rt.ByPos;return l?u.join(this.right.lineAt(a,c,r,s,a)):this.left.lineAt(a,c,r,i,o).join(u)}forEachLine(t,n,r,i,o,s){let a=i+this.left.height,l=o+this.left.length+this.break;if(this.break)t<l&&this.left.forEachLine(t,n,r,i,o,s),n>=l&&this.right.forEachLine(t,n,r,a,l,s);else{let u=this.lineAt(l,rt.ByPos,r,i,o);t<u.from&&this.left.forEachLine(t,u.from-1,r,i,o,s),u.to>=t&&u.from<=n&&s(u),n>u.to&&this.right.forEachLine(u.to+1,n,r,a,l,s)}}replace(t,n,r){let i=this.left.length+this.break;if(n<i)return this.balanced(this.left.replace(t,n,r),this.right);if(t>this.left.length)return this.balanced(this.left,this.right.replace(t-i,n-i,r));let o=[];t>0&&this.decomposeLeft(t,o);let s=o.length;for(let a of r)o.push(a);if(t>0&&hR(o,s-1),n<this.length){let a=o.length;this.decomposeRight(n,o),hR(o,a)}return Dn.of(o)}decomposeLeft(t,n){let r=this.left.length;if(t<=r)return this.left.decomposeLeft(t,n);n.push(this.left),this.break&&(r++,t>=r&&n.push(null)),t>r&&this.right.decomposeLeft(t-r,n)}decomposeRight(t,n){let r=this.left.length,i=r+this.break;if(t>=i)return this.right.decomposeRight(t-i,n);t<r&&this.left.decomposeRight(t,n),this.break&&t<i&&n.push(null),n.push(this.right)}balanced(t,n){return t.size>2*n.size||n.size>2*t.size?Dn.of(this.break?[t,null,n]:[t,n]):(this.left=cv(this.left,t),this.right=cv(this.right,n),this.setHeight(t.height+n.height),this.outdated=t.outdated||n.outdated,this.size=t.size+n.size,this.length=t.length+this.break+n.length,this)}updateHeight(t,n=0,r=!1,i){let{left:o,right:s}=this,a=n+o.length+this.break,l=null;return i&&i.from<=n+o.length&&i.more?l=o=o.updateHeight(t,n,r,i):o.updateHeight(t,n,r),i&&i.from<=a+s.length&&i.more?l=s=s.updateHeight(t,a,r,i):s.updateHeight(t,a,r),l?this.balanced(o,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function hR(e,t){let n,r;e[t]==null&&(n=e[t-1])instanceof an&&(r=e[t+1])instanceof an&&e.splice(t-1,3,new an(n.length+1+r.length))}const $Me=5;class WP{constructor(t,n){this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof mr?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new mr(r-this.pos,-1,0)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(t,n,r){if(t<n||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,o=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let s=n-t;r.block?this.addBlock(new d9(s,i,r)):(s||o||i>=$Me)&&this.addLineDeco(i,o,s)}else n>t&&this.span(t,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:t,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=n,this.writtenTo<t&&((this.writtenTo<t-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,t-1)),this.nodes.push(null)),this.pos>t&&this.nodes.push(new mr(this.pos-t,-1,0)),this.writtenTo=this.pos}blankContent(t,n){let r=new an(n-t);return this.oracle.doc.lineAt(t).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof mr)return t;let n=new mr(0,-1,0);return this.nodes.push(n),n}addBlock(t){this.enterLine();let n=t.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,n&&n.endSide>0&&(this.covering=t)}addLineDeco(t,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,t),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(t){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof mr)&&!this.isCovered?this.nodes.push(new mr(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=t;for(let i of this.nodes)i instanceof mr&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(t,n,r,i){let o=new WP(r,t);return _e.spans(n,r,i,o,0),o.finish(r)}}function BMe(e,t,n){let r=new FMe;return _e.compare(e,t,n,r,0),r.changes}class FMe{constructor(){this.changes=[]}compareRange(){}comparePoint(t,n,r,i){(t<n||r&&r.heightRelevant||i&&i.heightRelevant)&&Au(t,n,this.changes,5)}}function zMe(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.defaultView||window,o=Math.max(0,n.left),s=Math.min(i.innerWidth,n.right),a=Math.max(0,n.top),l=Math.min(i.innerHeight,n.bottom);for(let u=e.parentNode;u&&u!=r.body;)if(u.nodeType==1){let c=u,f=window.getComputedStyle(c);if((c.scrollHeight>c.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!="visible"){let h=c.getBoundingClientRect();o=Math.max(o,h.left),s=Math.min(s,h.right),a=Math.max(a,h.top),l=Math.min(u==e.parentNode?i.innerHeight:l,h.bottom)}u=f.position=="absolute"||f.position=="fixed"?c.offsetParent:c.parentNode}else if(u.nodeType==11)u=u.host;else break;return{left:o-n.left,right:Math.max(o,s)-n.left,top:a-(n.top+t),bottom:Math.max(a,l)-(n.top+t)}}function WMe(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left<n.innerWidth&&t.right>0&&t.top<n.innerHeight&&t.bottom>0}function UMe(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class d1{constructor(t,n,r,i){this.from=t,this.to=n,this.size=r,this.displaySize=i}static same(t,n){if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++){let i=t[r],o=n[r];if(i.from!=o.from||i.to!=o.to||i.size!=o.size)return!1}return!0}draw(t,n){return de.replace({widget:new HMe(this.displaySize*(n?t.scaleY:t.scaleX),n)}).range(this.from,this.to)}}class HMe extends eo{constructor(t,n){super(),this.size=t,this.vertical=n}eq(t){return t.size==this.size&&t.vertical==this.vertical}toDOM(){let t=document.createElement("div");return this.vertical?t.style.height=this.size+"px":(t.style.width=this.size+"px",t.style.height="2px",t.style.display="inline-block"),t}get estimatedHeight(){return this.vertical?this.size:-1}}class dR{constructor(t,n){this.view=t,this.state=n,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=pR,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Je.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let r=n.facet($P).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new NMe(r),this.stateDeco=mR(n),this.heightMap=Dn.empty().applyChanges(this.stateDeco,Re.empty,this.heightOracle.setDoc(n.doc),[new zr(0,0,0,n.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=de.set(this.lineGaps.map(i=>i.draw(this,!1))),this.scrollParent=t.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!t.some(({from:o,to:s})=>i>=o&&i<=s)){let{from:o,to:s}=this.lineBlockAt(i);t.push(new pm(o,s))}}return this.viewports=t.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?pR:new UP(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(Bf(t,this.scaler))})}update(t,n=null){this.state=t.state;let r=this.stateDeco;this.stateDeco=mR(this.state);let i=t.changedRanges,o=zr.extendWithRanges(i,BMe(r,this.stateDeco,t?t.changes:zt.empty(this.state.doc.length))),s=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);fR(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=s||vc)&&(t.flags|=2),a?(this.scrollAnchorPos=t.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=s);let l=o.length?this.mapViewport(this.viewport,t.changes):this.viewport;(n&&(n.range.head<l.from||n.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,n));let u=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,t.flags|=this.updateForViewport(),(u||!t.changes.empty||t.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(t.selectionSet||t.focusChanged)&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(q6)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:t}=this,n=t.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,o=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?Je.RTL:Je.LTR;let s=this.heightOracle.mustRefreshForWrapping(o)||this.mustMeasureContent==="refresh",a=n.getBoundingClientRect(),l=s||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let u=0,c=0;if(a.width&&a.height){let{scaleX:w,scaleY:S}=E6(n,a);(w>.005&&Math.abs(this.scaleX-w)>.005||S>.005&&Math.abs(this.scaleY-S)>.005)&&(this.scaleX=w,this.scaleY=S,u|=16,s=l=!0)}let f=(parseInt(r.paddingTop)||0)*this.scaleY,h=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=h)&&(this.paddingTop=f,this.paddingBottom=h,u|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=t.scrollDOM.clientWidth,u|=16);let d=T6(this.view.contentDOM,!1).y;d!=this.scrollParent&&(this.scrollParent=d,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=j6(this.scrollParent||t.win);let m=(this.printing?UMe:zMe)(n,this.paddingTop),v=m.top-this.pixelViewport.top,b=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(l=!0)),!this.inView&&!this.scrollTarget&&!WMe(t.dom))return 0;let x=a.width;if((this.contentDOMWidth!=x||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=t.scrollDOM.clientHeight,u|=16),l){let w=t.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(w)&&(s=!0),s||i.lineWrapping&&Math.abs(x-this.contentDOMWidth)>i.charWidth){let{lineHeight:S,charWidth:O,textHeight:A}=t.docView.measureTextSize();s=S>0&&i.refresh(o,S,O,A,Math.max(5,x/O),w),s&&(t.docView.minWidth=0,u|=16)}v>0&&b>0?c=Math.max(v,b):v<0&&b<0&&(c=Math.min(v,b)),fR();for(let S of this.viewports){let O=S.from==this.viewport.from?w:t.docView.measureVisibleLineHeights(S);this.heightMap=(s?Dn.empty().applyChanges(this.stateDeco,Re.empty,this.heightOracle,[new zr(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(i,0,s,new RMe(S.from,O))}vc&&(u|=2)}let k=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return k&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),u|=this.updateForViewport()),(u&2||k)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps,t)),u|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),u}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,n){let r=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),i=this.heightMap,o=this.heightOracle,{visibleTop:s,visibleBottom:a}=this,l=new pm(i.lineAt(s-r*1e3,rt.ByHeight,o,0,0).from,i.lineAt(a+(1-r)*1e3,rt.ByHeight,o,0,0).to);if(n){let{head:u}=n.range;if(u<l.from||u>l.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=i.lineAt(u,rt.ByPos,o,0,0),h;n.y=="center"?h=(f.top+f.bottom)/2-c/2:n.y=="start"||n.y=="nearest"&&u<l.from?h=f.top:h=f.bottom-c,l=new pm(i.lineAt(h-1e3/2,rt.ByHeight,o,0,0).from,i.lineAt(h+c+1e3/2,rt.ByHeight,o,0,0).to)}}return l}mapViewport(t,n){let r=n.mapPos(t.from,-1),i=n.mapPos(t.to,1);return new pm(this.heightMap.lineAt(r,rt.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,rt.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:t,to:n},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(t,rt.ByPos,this.heightOracle,0,0),{bottom:o}=this.heightMap.lineAt(n,rt.ByPos,this.heightOracle,0,0),{visibleTop:s,visibleBottom:a}=this;return(t==0||i<=s-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||o>=a+Math.max(10,Math.min(r,250)))&&i>s-2*1e3&&o<a+2*1e3}mapLineGaps(t,n){if(!t.length||n.empty)return t;let r=[];for(let i of t)n.touchesRange(i.from,i.to)||r.push(new d1(n.mapPos(i.from),n.mapPos(i.to),i.size,i.displaySize));return r}ensureLineGaps(t,n){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,o=i>>1,s=i<<1;if(this.defaultTextDirection!=Je.LTR&&!r)return[];let a=[],l=(c,f,h,d)=>{if(f-c<o)return;let p=this.state.selection.main,m=[p.from];p.empty||m.push(p.to);for(let b of m)if(b>c&&b<f){l(c,b-10,h,d),l(b+10,f,h,d);return}let v=qMe(t,b=>b.from>=h.from&&b.to<=h.to&&Math.abs(b.from-c)<o&&Math.abs(b.to-f)<o&&!m.some(y=>b.from<y&&b.to>y));if(!v){if(f<h.to&&n&&r&&n.visibleRanges.some(x=>x.from<=f&&x.to>=f)){let x=n.moveToLineBoundary(V.cursor(f),!1,!0).head;x>c&&(f=x)}let b=this.gapSize(h,c,f,d),y=r||b<2e6?b:2e6;v=new d1(c,f,b,y)}a.push(v)},u=c=>{if(c.length<s||c.type!=fn.Text)return;let f=VMe(c.from,c.to,this.stateDeco);if(f.total<s)return;let h=this.scrollTarget?this.scrollTarget.range.head:null,d,p;if(r){let m=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,v,b;if(h!=null){let y=gm(f,h),x=((this.visibleBottom-this.visibleTop)/2+m)/c.height;v=y-x,b=y+x}else v=(this.visibleTop-c.top-m)/c.height,b=(this.visibleBottom-c.top+m)/c.height;d=mm(f,v),p=mm(f,b)}else{let m=f.total*this.heightOracle.charWidth,v=i*this.heightOracle.charWidth,b=0;if(m>2e6)for(let S of t)S.from>=c.from&&S.from<c.to&&S.size!=S.displaySize&&S.from*this.heightOracle.charWidth+b<this.pixelViewport.left&&(b=S.size-S.displaySize);let y=this.pixelViewport.left+b,x=this.pixelViewport.right+b,k,w;if(h!=null){let S=gm(f,h),O=((x-y)/2+v)/m;k=S-O,w=S+O}else k=(y-v)/m,w=(x+v)/m;d=mm(f,k),p=mm(f,w)}d>c.from&&l(c.from,d,c,f),p<c.to&&l(p,c.to,c,f)};for(let c of this.viewportLines)Array.isArray(c.type)?c.type.forEach(u):u(c);return a}gapSize(t,n,r,i){let o=gm(i,r)-gm(i,n);return this.heightOracle.lineWrapping?t.height*o:i.total*this.heightOracle.charWidth*o}updateLineGaps(t){d1.same(t,this.lineGaps)||(this.lineGaps=t,this.lineGapDeco=de.set(t.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(t){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];_e.spans(n,this.viewport.from,this.viewport.to,{span(o,s){r.push({from:o,to:s})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let o=0;o<r.length&&!(i&8);o++){let s=this.visibleRanges[o],a=r[o];(s.from!=a.from||s.to!=a.to)&&(i|=4,t&&t.mapPos(s.from,-1)==a.from&&t.mapPos(s.to,1)==a.to||(i|=8))}return this.visibleRanges=r,i}lineBlockAt(t){return t>=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(n=>n.from<=t&&n.to>=t)||Bf(this.heightMap.lineAt(t,rt.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=t&&n.bottom>=t)||Bf(this.heightMap.lineAt(this.scaler.fromDOM(t),rt.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(t){let n=this.lineBlockAtHeight(t+8);return n.from>=this.viewport.from||this.viewportLines[0].top-t>200?n:this.viewportLines[0]}elementAtHeight(t){return Bf(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class pm{constructor(t,n){this.from=t,this.to=n}}function VMe(e,t,n){let r=[],i=e,o=0;return _e.spans(n,e,t,{span(){},point(s,a){s>i&&(r.push({from:i,to:s}),o+=s-i),i=a}},20),i<t&&(r.push({from:i,to:t}),o+=t-i),{total:o,ranges:r}}function mm({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let i=0;;i++){let{from:o,to:s}=t[i],a=s-o;if(r<=a)return o+r;r-=a}}function gm(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}function qMe(e,t){for(let n of e)if(t(n))return n}const pR={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function mR(e){let t=e.facet(ab).filter(r=>typeof r!="function"),n=e.facet(BP).filter(r=>typeof r!="function");return n.length&&t.push(_e.join(n)),t}class UP{constructor(t,n,r){let i=0,o=0,s=0;this.viewports=r.map(({from:a,to:l})=>{let u=n.lineAt(a,rt.ByPos,t,0,0).top,c=n.lineAt(l,rt.ByPos,t,0,0).bottom;return i+=c-u,{from:a,to:l,top:u,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let a of this.viewports)a.domTop=s+(a.top-o)*this.scale,s=a.domBottom=a.domTop+(a.bottom-a.top),o=a.bottom}toDOM(t){for(let n=0,r=0,i=0;;n++){let o=n<this.viewports.length?this.viewports[n]:null;if(!o||t<o.top)return i+(t-r)*this.scale;if(t<=o.bottom)return o.domTop+(t-o.top);r=o.bottom,i=o.domBottom}}fromDOM(t){for(let n=0,r=0,i=0;;n++){let o=n<this.viewports.length?this.viewports[n]:null;if(!o||t<o.domTop)return r+(t-i)/this.scale;if(t<=o.domBottom)return o.top+(t-o.domTop);r=o.bottom,i=o.domBottom}}eq(t){return t instanceof UP?this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every((n,r)=>n.from==t.viewports[r].from&&n.to==t.viewports[r].to):!1}}function Bf(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new ci(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(i=>Bf(i,t)):e._content)}const ym=se.define({combine:e=>e.join(" ")}),mO=se.define({combine:e=>e.indexOf(!0)>-1}),gO=Ms.newName(),p9=Ms.newName(),m9=Ms.newName(),g9={"&light":"."+p9,"&dark":"."+m9};function yO(e,t,n){return new Ms(t,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return e;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):e+" "+r}})}const KMe=yO("."+gO,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},g9),GMe={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},p1=oe.ie&&oe.ie_version<=11;class QMe{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new Cje,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(oe.ie&&oe.ie_version<=11||oe.ios&&t.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&oe.android&&t.constructor.EDIT_CONTEXT!==!1&&!(oe.chrome&&oe.chrome_version<126)&&(this.editContext=new YMe(t),t.state.facet(co)&&(t.contentDOM.editContext=this.editContext.editContext)),p1&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(t.scrollDOM)),this.addWindowListeners(this.win=t.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){(t.type=="change"||!t.type)&&!t.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((n,r)=>n!=t[r]))){this.gapIntersection.disconnect();for(let n of t)this.gapIntersection.observe(n);this.gaps=t}}onSelectionChange(t){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(co)?r.root.activeElement!=this.dom:!uh(this.dom,i))return;let o=i.anchorNode&&r.docView.tile.nearest(i.anchorNode);if(o&&o.isWidget()&&o.widget.ignoreEvent(t)){n||(this.selectionChanged=!1);return}(oe.ie&&oe.ie_version<=11||oe.android&&oe.chrome)&&!r.state.selection.main.empty&&i.focusNode&&fh(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,n=Md(t.root);if(!n)return!1;let r=oe.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&XMe(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=uh(this.dom,r);return i&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime<Date.now()-300&&Pje(this.dom,r)?(this.view.inputState.lastFocusTime=0,t.docView.updateSelection(),!1):(this.selectionRange.setRange(r),i&&(this.selectionChanged=!0),!0)}setSelectionRange(t,n){this.selectionRange.set(t.node,t.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let t=0,n=null;for(let r=this.dom;r;)if(r.nodeType==1)!n&&t<this.scrollTargets.length&&this.scrollTargets[t]==r?t++:n||(n=this.scrollTargets.slice(0,t)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(t<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,t)),n){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=n)r.addEventListener("scroll",this.onScroll)}}ignore(t){if(!this.active)return t();try{return this.stop(),t()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,GMe),p1&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),p1&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(t,n){var r;if(!this.delayedAndroidKey){let i=()=>{let o=this.delayedAndroidKey;o&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=o.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&o.force&&Pu(this.dom,o.key,o.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let o of t){let s=this.readMutation(o);s&&(s.typeOver&&(i=!0),n==-1?{from:n,to:r}=s:(n=Math.min(s.from,n),r=Math.max(s.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:t,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&uh(this.dom,this.selectionRange);if(t<0&&!i)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new pMe(this.view,t,n,r);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=r9(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!uv(this.view.state.selection,n.newSel.main))&&this.view.update([]),i}readMutation(t){let n=this.view.docView.tile.nearest(t.target);if(!n||n.isWidget())return null;if(n.markDirty(t.type=="attributes"),t.type=="childList"){let r=gR(n,t.previousSibling||t.target.previousSibling,-1),i=gR(n,t.nextSibling||t.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(co)!=t.state.facet(co)&&(t.view.contentDOM.editContext=t.state.facet(co)?this.editContext.editContext:null))}destroy(){var t,n,r;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function gR(e,t,n){for(;t;){let r=Pt.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i!=e.dom?i:n>0?t.nextSibling:t.previousSibling}return null}function yR(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,s=e.docView.domAtPos(e.state.selection.main.anchor,1);return fh(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function XMe(e,t){if(t.getComposedRanges){let i=t.getComposedRanges(e.root)[0];if(i)return yR(e,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",r,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",r,!0),n?yR(e,n):null}class YMe{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let n=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=r=>{let i=t.state.selection.main,{anchor:o,head:s}=i,a=this.toEditorPos(r.updateRangeStart),l=this.toEditorPos(r.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:a,drifted:!1});let u=l-a>r.text.length;a==this.from&&o<this.from?a=o:l==this.to&&o>this.to&&(l=o);let c=i9(t.state.sliceDoc(a,l),r.text,(u?i.from:i.to)-a,u?"end":null);if(!c){let h=V.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));uv(h,i)||t.dispatch({selection:h,userEvent:"select"});return}let f={from:c.from+a,to:c.toA+a,insert:Re.of(r.text.slice(c.from,c.toB).split(`
|
|
438
|
-
`))};if((oe.mac||oe.android)&&f.from==s-1&&/^\. ?$/.test(r.text)&&t.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:a,to:l,insert:Re.of([r.text.replace("."," ")])}),this.pendingContextChange=f,!t.state.readOnly){let h=this.to-this.from+(f.to-f.from+f.insert.length);zP(t,f,V.single(this.toEditorPos(r.selectionStart,h),this.toEditorPos(r.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)),f.from<f.to&&!f.insert.length&&t.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],o=null;for(let s=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);s<a;s++){let l=t.coordsForChar(s);o=l&&new DOMRect(l.left,l.top,l.right-l.left,l.bottom-l.top)||o||new DOMRect,i.push(o)}n.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{let i=[];for(let o of r.getTextFormats()){let s=o.underlineStyle,a=o.underlineThickness;if(!/none/i.test(s)&&!/none/i.test(a)){let l=this.toEditorPos(o.rangeStart),u=this.toEditorPos(o.rangeEnd);if(l<u){let c=`text-decoration: underline ${/^[a-z]/.test(s)?s+" ":s=="Dashed"?"dashed ":s=="Squiggle"?"wavy ":""}${/thin/i.test(a)?1:2}px`;i.push(de.mark({attributes:{style:c}}).range(l,u))}}}t.dispatch({effects:G6.of(de.set(i))})},this.handlers.compositionstart=()=>{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(t.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=Md(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let n=0,r=!1,i=this.pendingContextChange;return t.changes.iterChanges((o,s,a,l,u)=>{if(r)return;let c=u.length-(s-o);if(i&&s>=i.to)if(i.from==o&&i.to==s&&i.insert.eq(u)){i=this.pendingContextChange=null,n+=c,this.to+=c;return}else i=null,this.revertPending(t.state);if(o+=n,s+=n,s<=this.from)this.from+=c,this.to+=c;else if(o<this.to){if(o<this.from||s>this.to||this.to-this.from+u.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(o),this.toContextPos(s),u.toString()),this.to+=c}n+=c}),i&&!r&&this.revertPending(t.state),!r}update(t){let n=this.pendingContextChange,r=t.startState.selection.main;this.composing&&(this.composing.drifted||!t.changes.touchesRange(r.from,r.to)&&t.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.reset(t.state)):(t.docChanged||t.selectionSet||n)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:n}=t.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(t.doc.length,n+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),t.doc.sliceString(n.from,n.to))}setSelection(t){let{main:n}=t.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(t){let{head:n}=t.selection.main;return!(this.from>0&&n-this.from<500||this.to<t.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(t,n=this.to-this.from){t=Math.min(t,n);let r=this.composing;return r&&r.drifted?r.editorBase+(t-r.contextBase):t+this.from}toContextPos(t){let n=this.composing;return n&&n.drifted?n.contextBase+(t-n.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class ie{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:r}=t;this.dispatchTransactions=t.dispatchTransactions||r&&(i=>i.forEach(o=>r(o,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=t.root||Aje(t.parent)||document,this.viewState=new dR(this,t.state||Ne.create(t)),t.scrollTo&&t.scrollTo.is(fm)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(au).map(i=>new l1(i));for(let i of this.plugins)i.update(this);this.observer=new QMe(this),this.inputState=new vMe(this),this.inputState.ensureHandlers(this.plugins),this.docView=new eR(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...t){let n=t.length==1&&t[0]instanceof Kt?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(n,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,o=this.state;for(let h of t){if(h.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=h.state}if(this.destroyed){this.viewState.state=o;return}let s=this.hasFocus,a=0,l=null;t.some(h=>h.annotation(c9))?(this.inputState.notifiedFocused=s,a=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,l=f9(o,s),l||(a=1));let u=this.observer.delayedAndroidKey,c=null;if(u?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(c=null)):this.observer.clear(),o.facet(Ne.phrases)!=this.state.facet(Ne.phrases))return this.setState(o);i=sv.create(this,o,t),i.flags|=a;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let h of t){if(f&&(f=f.map(h.changes)),h.scrollIntoView){let{main:d}=h.state.selection,{x:p,y:m}=this.state.facet(ie.cursorScrollMargin);f=new Eu(d.empty?d:V.cursor(d.head,d.head>d.anchor?-1:1),"nearest","nearest",m,p)}for(let d of h.effects)d.is(fm)&&(f=d.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=fv.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet($f)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(h=>h.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(ym)!=i.state.facet(ym)&&(this.viewState.mustMeasureContent=!0),(n||r||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let h of this.state.facet(cO))try{h(i)}catch(d){Gn(this.state,d,"update listener")}(l||c)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),c&&!r9(this,c)&&u.force&&Pu(this.contentDOM,u.key,u.keyCode)})}setState(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new dR(this,t),this.plugins=t.facet(au).map(r=>new l1(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new eR(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(t){let n=t.startState.facet(au),r=t.state.facet(au);if(n!=r){let i=[];for(let o of r){let s=n.indexOf(o);if(s<0)i.push(new l1(o));else{let a=this.plugins[s];a.mustUpdate=t,i.push(a)}}for(let o of this.plugins)o.mustUpdate!=t&&o.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=t;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let t of this.plugins){let n=t.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){Gn(this.state,r,"doc view update listener")}}}measure(t=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let n=null,r=this.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:o,scrollAnchorHeight:s}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(s<0)if(j6(r||this.win))o=-1,s=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(i);o=d.from,s=d.top}this.updateState=1;let l=this.viewState.measure();if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];l&4||([this.measureRequests,u]=[u,this.measureRequests]);let c=u.map(d=>{try{return d.read(this)}catch(p){return Gn(this.state,p),vR}}),f=sv.create(this,this.state,[]),h=!1;f.flags|=l,n?n.flags|=l:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),h=this.docView.update(f),h&&this.docViewUpdate());for(let d=0;d<u.length;d++)if(c[d]!=vR)try{let p=u[d];p.write&&p.write(c[d],this)}catch(p){Gn(this.state,p)}if(h&&this.docView.updateSelection(!0),!f.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,s=-1;continue}else{let p=((o<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(o).top)-s)/this.scaleY;if((p>1||p<-1)&&(r==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i=i+p,r?r.scrollTop+=p:this.win.scrollBy(0,p),s=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let a of this.state.facet(cO))a(n)}get themeClasses(){return gO+" "+(this.state.facet(mO)?m9:p9)+" "+this.state.facet(ym)}updateAttrs(){let t=bR(this,Q6,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(co)?"true":"false",class:"cm-content",style:`${oe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),bR(this,$P,n);let r=this.observer.ignore(()=>{let i=GN(this.contentDOM,this.contentAttrs,n),o=GN(this.dom,this.editorAttrs,t);return i||o});return this.editorAttrs=t,this.contentAttrs=n,r}showAnnouncements(t){let n=!0;for(let r of t)for(let i of r.effects)if(i.is(ie.announce)){n&&(this.announceDOM.textContent=""),n=!1;let o=this.announceDOM.appendChild(document.createElement("div"));o.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet($f);let t=this.state.facet(ie.cspNonce);Ms.mount(this.root,this.styleModules.concat(KMe).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===t.key){this.measureRequests[n]=t;return}}this.measureRequests.push(t)}}plugin(t){let n=this.pluginMap.get(t);return(n===void 0||n&&n.plugin!=t)&&this.pluginMap.set(t,n=this.plugins.find(r=>r.plugin==t)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,n,r){return h1(this,t,tR(this,t,n,r))}moveByGroup(t,n){return h1(this,t,tR(this,t,n,r=>lMe(this,t.head,r)))}visualLineSide(t,n){let r=this.bidiSpans(t),i=this.textDirectionAt(t.from),o=r[n?r.length-1:0];return V.cursor(o.side(n,i)+t.from,o.forward(!n,i)?1:-1)}moveToLineBoundary(t,n,r=!0){return aMe(this,t,n,r)}moveVertically(t,n,r){return h1(this,t,uMe(this,t,n,r))}domAtPos(t,n=1){return this.docView.domAtPos(t,n)}posAtDOM(t,n=0){return this.docView.posFromDOM(t,n)}posAtCoords(t,n=!0){this.readMeasured();let r=dO(this,t,n);return r&&r.pos}posAndSideAtCoords(t,n=!0){return this.readMeasured(),dO(this,t,n)}coordsAtPos(t,n=1){this.readMeasured();let r=this.docView.coordsAt(t,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(t),o=this.bidiSpans(i),s=o[Li.find(o,t-i.from,-1,n)];return Id(r,s.dir==Je.LTR==n>0)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(V6)||t<this.viewport.from||t>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>ZMe)return L6(t.length);let n=this.textDirectionAt(t.from),r;for(let o of this.bidiCache)if(o.from==t.from&&o.dir==n&&(o.fresh||D6(o.isolates,r=YN(this,t))))return o.order;r||(r=YN(this,t));let i=Nje(t.text,n,r);return this.bidiCache.push(new fv(t.from,t.to,n,r,!0,i)),i}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||oe.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{_6(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,n={}){var r,i,o,s;return fm.of(new Eu(typeof t=="number"?V.cursor(t):t,(r=n.y)!==null&&r!==void 0?r:"nearest",(i=n.x)!==null&&i!==void 0?i:"nearest",(o=n.yMargin)!==null&&o!==void 0?o:5,(s=n.xMargin)!==null&&s!==void 0?s:5))}scrollSnapshot(){let{scrollTop:t,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(t);return fm.of(new Eu(V.cursor(r.from),"start","start",r.top-t,n,!0))}setTabFocusMode(t){t==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof t=="boolean"?this.inputState.tabFocusMode=t?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return Et.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return Et.define(()=>({}),{eventObservers:t})}static theme(t,n){let r=Ms.newName(),i=[ym.of(r),$f.of(yO(`.${r}`,t))];return n&&n.dark&&i.push(mO.of(!0)),i}static baseTheme(t){return bl.lowest($f.of(yO("."+gO,t,g9)))}static findFromDOM(t){var n;let r=t.querySelector(".cm-content"),i=r&&Pt.get(r)||Pt.get(t);return((n=i?.root)===null||n===void 0?void 0:n.view)||null}}ie.styleModule=$f;ie.inputHandler=U6;ie.clipboardInputFilter=DP;ie.clipboardOutputFilter=LP;ie.scrollHandler=K6;ie.focusChangeEffect=H6;ie.perLineTextDirection=V6;ie.exceptionSink=W6;ie.updateListener=cO;ie.editable=co;ie.mouseSelectionStyle=z6;ie.dragMovesSelection=F6;ie.clickAddsSelectionRange=B6;ie.decorations=ab;ie.blockWrappers=X6;ie.outerDecorations=BP;ie.atomicRanges=fp;ie.bidiIsolatedRanges=Y6;ie.cursorScrollMargin=se.define({combine:e=>{let t=5,n=5;for(let r of e)typeof r=="number"?t=n=r:{x:t,y:n}=r;return{x:t,y:n}}});ie.scrollMargins=Z6;ie.darkTheme=mO;ie.cspNonce=se.define({combine:e=>e.length?e[0]:""});ie.contentAttributes=$P;ie.editorAttributes=Q6;ie.lineWrapping=ie.contentAttributes.of({class:"cm-lineWrapping"});ie.announce=ke.define();const ZMe=4096,vR={};class fv{constructor(t,n,r,i,o,s){this.from=t,this.to=n,this.dir=r,this.isolates=i,this.fresh=o,this.order=s}static update(t,n){if(n.empty&&!t.some(o=>o.fresh))return t;let r=[],i=t.length?t[t.length-1].dir:Je.LTR;for(let o=Math.max(0,t.length-10);o<t.length;o++){let s=t[o];s.dir==i&&!n.touchesRange(s.from,s.to)&&r.push(new fv(n.mapPos(s.from,1),n.mapPos(s.to,-1),s.dir,s.isolates,!1,s.order))}return r}}function bR(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let o=r[i],s=typeof o=="function"?o(e):o;s&&IP(s,n)}return n}const JMe=oe.mac?"mac":oe.windows?"win":oe.linux?"linux":"key";function eIe(e,t){const n=e.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,o,s,a;for(let l=0;l<n.length-1;++l){const u=n[l];if(/^(cmd|meta|m)$/i.test(u))a=!0;else if(/^a(lt)?$/i.test(u))i=!0;else if(/^(c|ctrl|control)$/i.test(u))o=!0;else if(/^s(hift)?$/i.test(u))s=!0;else if(/^mod$/i.test(u))t=="mac"?a=!0:o=!0;else throw new Error("Unrecognized modifier name: "+u)}return i&&(r="Alt-"+r),o&&(r="Ctrl-"+r),a&&(r="Meta-"+r),s&&(r="Shift-"+r),r}function vm(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n!==!1&&t.shiftKey&&(e="Shift-"+e),e}const tIe=bl.default(ie.domEventHandlers({keydown(e,t){return v9(y9(t.state),e,t,"editor")}})),fb=se.define({enables:tIe}),xR=new WeakMap;function y9(e){let t=e.facet(fb),n=xR.get(t);return n||xR.set(t,n=iIe(t.reduce((r,i)=>r.concat(i),[]))),n}function nIe(e,t,n){return v9(y9(e.state),t,e,n)}let es=null;const rIe=4e3;function iIe(e,t=JMe){let n=Object.create(null),r=Object.create(null),i=(s,a)=>{let l=r[s];if(l==null)r[s]=a;else if(l!=a)throw new Error("Key binding "+s+" is used both as a regular binding and as a multi-stroke prefix")},o=(s,a,l,u,c)=>{var f,h;let d=n[s]||(n[s]=Object.create(null)),p=a.split(/ (?!$)/).map(b=>eIe(b,t));for(let b=1;b<p.length;b++){let y=p.slice(0,b).join(" ");i(y,!0),d[y]||(d[y]={preventDefault:!0,stopPropagation:!1,run:[x=>{let k=es={view:x,prefix:y,scope:s};return setTimeout(()=>{es==k&&(es=null)},rIe),!0}]})}let m=p.join(" ");i(m,!1);let v=d[m]||(d[m]={preventDefault:!1,stopPropagation:!1,run:((h=(f=d._any)===null||f===void 0?void 0:f.run)===null||h===void 0?void 0:h.slice())||[]});l&&v.run.push(l),u&&(v.preventDefault=!0),c&&(v.stopPropagation=!0)};for(let s of e){let a=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let u of a){let c=n[u]||(n[u]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=s;for(let h in c)c[h].run.push(d=>f(d,vO))}let l=s[t]||s.key;if(l)for(let u of a)o(u,l,s.run,s.preventDefault,s.stopPropagation),s.shift&&o(u,"Shift-"+l,s.shift,s.preventDefault,s.stopPropagation)}return n}let vO=null;function v9(e,t,n,r){vO=t;let i=bje(t),o=zn(i,0),s=Ni(o)==i.length&&i!=" ",a="",l=!1,u=!1,c=!1;es&&es.view==n&&es.scope==r&&(a=es.prefix+" ",s9.indexOf(t.keyCode)<0&&(u=!0,es=null));let f=new Set,h=v=>{if(v){for(let b of v.run)if(!f.has(b)&&(f.add(b),b(n)))return v.stopPropagation&&(c=!0),!0;v.preventDefault&&(v.stopPropagation&&(c=!0),u=!0)}return!1},d=e[r],p,m;return d&&(h(d[a+vm(i,t,!s)])?l=!0:s&&(t.altKey||t.metaKey||t.ctrlKey)&&!(oe.windows&&t.ctrlKey&&t.altKey)&&!(oe.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=Is[t.keyCode])&&p!=i?(h(d[a+vm(p,t,!0)])||t.shiftKey&&(m=_d[t.keyCode])!=i&&m!=p&&h(d[a+vm(m,t,!1)]))&&(l=!0):s&&t.shiftKey&&h(d[a+vm(i,t,!0)])&&(l=!0),!l&&h(d._any)&&(l=!0)),u&&(l=!0),l&&c&&t.stopPropagation(),vO=null,l}class Fa{constructor(t,n,r,i,o){this.className=t,this.left=n,this.top=r,this.width=i,this.height=o}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,n){return n.className!=this.className?!1:(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width!=null&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,n,r){if(r.empty){let i=t.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let o=b9(t);return[new Fa(n,i.left-o.left,i.top-o.top,null,i.bottom-i.top)]}else return oIe(t,n,r)}}function b9(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==Je.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function wR(e,t,n,r){let i=e.coordsAtPos(t,n*2);if(!i)return r;let o=e.dom.getBoundingClientRect(),s=(i.top+i.bottom)/2,a=e.posAtCoords({x:o.left+1,y:s}),l=e.posAtCoords({x:o.right-1,y:s});return a==null||l==null?r:{from:Math.max(r.from,Math.min(a,l)),to:Math.min(r.to,Math.max(a,l))}}function oIe(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let r=Math.max(n.from,e.viewport.from),i=Math.min(n.to,e.viewport.to),o=e.textDirection==Je.LTR,s=e.contentDOM,a=s.getBoundingClientRect(),l=b9(e),u=s.querySelector(".cm-line"),c=u&&window.getComputedStyle(u),f=a.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),h=a.right-(c?parseInt(c.paddingRight):0),d=hO(e,r,1),p=hO(e,i,-1),m=d.type==fn.Text?d:null,v=p.type==fn.Text?p:null;if(m&&(e.lineWrapping||d.widgetLineBreaks)&&(m=wR(e,r,1,m)),v&&(e.lineWrapping||p.widgetLineBreaks)&&(v=wR(e,i,-1,v)),m&&v&&m.from==v.from&&m.to==v.to)return y(x(n.from,n.to,m));{let w=m?x(n.from,null,m):k(d,!1),S=v?x(null,n.to,v):k(p,!0),O=[];return(m||d).to<(v||p).from-(m&&v?1:0)||d.widgetLineBreaks>1&&w.bottom+e.defaultLineHeight/2<S.top?O.push(b(f,w.bottom,h,S.top)):w.bottom<S.top&&e.elementAtHeight((w.bottom+S.top)/2).type==fn.Text&&(w.bottom=S.top=(w.bottom+S.top)/2),y(w).concat(O).concat(y(S))}function b(w,S,O,A){return new Fa(t,w-l.left,S-l.top,Math.max(0,O-w),A-S)}function y({top:w,bottom:S,horizontal:O}){let A=[];for(let P=0;P<O.length;P+=2)A.push(b(O[P],w,O[P+1],S));return A}function x(w,S,O){let A=1e9,P=-1e9,M=[];function j(R,N,B,F,$){let z=e.coordsAtPos(R,R==O.to?-2:2),T=e.coordsAtPos(B,B==O.from?2:-2);!z||!T||(A=Math.min(z.top,T.top,A),P=Math.max(z.bottom,T.bottom,P),$==Je.LTR?M.push(o&&N?f:z.left,o&&F?h:T.right):M.push(!o&&F?f:T.left,!o&&N?h:z.right))}let E=w??O.from,D=S??O.to;for(let R of e.visibleRanges)if(R.to>E&&R.from<D)for(let N=Math.max(R.from,E),B=Math.min(R.to,D);;){let F=e.state.doc.lineAt(N);for(let $ of e.bidiSpans(F)){let z=$.from+F.from,T=$.to+F.from;if(z>=B)break;T>N&&j(Math.max(z,N),w==null&&z<=E,Math.min(T,B),S==null&&T>=D,$.dir)}if(N=F.to+1,N>=B)break}return M.length==0&&j(E,w==null,D,S==null,e.textDirection),{top:A,bottom:P,horizontal:M}}function k(w,S){let O=a.top+(S?w.top:w.bottom);return{top:O,bottom:O,horizontal:[]}}}function sIe(e,t){return e.constructor==t.constructor&&e.eq(t)}class aIe{constructor(t,n){this.view=t,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,t)}update(t){t.startState.facet(rg)!=t.state.facet(rg)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){this.layer.updateOnDocViewUpdate!==!1&&t.requestMeasure(this.measureReq)}setOrder(t){let n=0,r=t.facet(rg);for(;n<r.length&&r[n]!=this.layer;)n++;this.dom.style.zIndex=String((this.layer.above?150:-1)-n)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:t,scaleY:n}=this.view;(t!=this.scaleX||n!=this.scaleY)&&(this.scaleX=t,this.scaleY=n,this.dom.style.transform=`scale(${1/t}, ${1/n})`)}draw(t){if(t.length!=this.drawn.length||t.some((n,r)=>!sIe(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let i of t)i.update&&n&&i.constructor&&this.drawn[r].constructor&&i.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(i.draw(),n);for(;n;){let i=n.nextSibling;n.remove(),n=i}this.drawn=t,oe.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const rg=se.define();function x9(e){return[Et.define(t=>new aIe(t,e)),rg.of(e)]}const bc=se.define({combine(e){return Ji(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(t,n)=>Math.min(t,n),drawRangeCursor:(t,n)=>t||n})}});function lIe(e={}){return[bc.of(e),uIe,cIe,fIe,q6.of(!0)]}function w9(e){return e.startState.facet(bc)!=e.state.facet(bc)}const uIe=x9({above:!0,markers(e){let{state:t}=e,n=t.facet(bc),r=[];for(let i of t.selection.ranges){let o=i==t.selection.main;if(i.empty||n.drawRangeCursor&&!(o&&oe.ios&&n.iosSelectionHandles)){let s=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=i.empty?i:V.cursor(i.head,i.assoc);for(let l of Fa.forRange(e,s,a))r.push(l)}}return r},update(e,t){e.transactions.some(r=>r.selection)&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=w9(e);return n&&SR(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){SR(t.state,e)},class:"cm-cursorLayer"});function SR(e,t){t.style.animationDuration=e.facet(bc).cursorBlinkRate+"ms"}const cIe=x9({above:!1,markers(e){let t=[],{main:n,ranges:r}=e.state.selection;for(let i of r)if(!i.empty)for(let o of Fa.forRange(e,"cm-selectionBackground",i))t.push(o);if(oe.ios&&!n.empty&&e.state.facet(bc).iosSelectionHandles){for(let i of Fa.forRange(e,"cm-selectionHandle cm-selectionHandle-start",V.cursor(n.from,1)))t.push(i);for(let i of Fa.forRange(e,"cm-selectionHandle cm-selectionHandle-end",V.cursor(n.to,1)))t.push(i)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||w9(e)},class:"cm-selectionLayer"}),fIe=bl.highest(ie.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),S9=ke.define({map(e,t){return e==null?null:t.mapPos(e)}}),Ff=kn.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((n,r)=>r.is(S9)?r.value:n,e)}}),hIe=Et.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(Ff);n==null?this.cursor!=null&&((t=this.cursor)===null||t===void 0||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(Ff)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(Ff),n=t!=null&&e.coordsAtPos(t);if(!n)return null;let r=e.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-r.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(Ff)!=e&&this.view.dispatch({effects:S9.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){(e.target==this.view.contentDOM||!this.view.contentDOM.contains(e.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function dIe(){return[Ff,hIe]}function kR(e,t,n,r,i){t.lastIndex=0;for(let o=e.iterRange(n,r),s=n,a;!o.next().done;s+=o.value.length)if(!o.lineBreak)for(;a=t.exec(o.value);)i(s+a.index,a)}function pIe(e,t){let n=e.visibleRanges;if(n.length==1&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let r=[];for(let{from:i,to:o}of n)i=Math.max(e.state.doc.lineAt(i).from,i-t),o=Math.min(e.state.doc.lineAt(o).to,o+t),r.length&&r[r.length-1].to>=i?r[r.length-1].to=o:r.push({from:i,to:o});return r}class mIe{constructor(t){const{regexp:n,decoration:r,decorate:i,boundary:o,maxLength:s=1e3}=t;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,i)this.addMatch=(a,l,u,c)=>i(c,u,u+a[0].length,a,l);else if(typeof r=="function")this.addMatch=(a,l,u,c)=>{let f=r(a,l,u);f&&c(u,u+a[0].length,f)};else if(r)this.addMatch=(a,l,u,c)=>c(u,u+a[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=o,this.maxLength=s}createDeco(t){let n=new Io,r=n.add.bind(n);for(let{from:i,to:o}of pIe(t,this.maxLength))kR(t.state.doc,this.regexp,i,o,(s,a)=>this.addMatch(a,t,s,r));return n.finish()}updateDeco(t,n){let r=1e9,i=-1;return t.docChanged&&t.changes.iterChanges((o,s,a,l)=>{l>=t.view.viewport.from&&a<=t.view.viewport.to&&(r=Math.min(a,r),i=Math.max(l,i))}),t.viewportMoved||i-r>1e3?this.createDeco(t.view):i>-1?this.updateRange(t.view,n.map(t.changes),r,i):n}updateRange(t,n,r,i){for(let o of t.visibleRanges){let s=Math.max(o.from,r),a=Math.min(o.to,i);if(a>=s){let l=t.state.doc.lineAt(s),u=l.to<a?t.state.doc.lineAt(a):l,c=Math.max(o.from,l.from),f=Math.min(o.to,u.to);if(this.boundary){for(;s>l.from;s--)if(this.boundary.test(l.text[s-1-l.from])){c=s;break}for(;a<u.to;a++)if(this.boundary.test(u.text[a-u.from])){f=a;break}}let h=[],d,p=(m,v,b)=>h.push(b.range(m,v));if(l==u)for(this.regexp.lastIndex=c-l.from;(d=this.regexp.exec(l.text))&&d.index<f-l.from;)this.addMatch(d,t,d.index+l.from,p);else kR(t.state.doc,this.regexp,c,f,(m,v)=>this.addMatch(v,t,m,p));n=n.update({filterFrom:c,filterTo:f,filter:(m,v)=>m<c||v>f,add:h})}}return n}}const bO=/x/.unicode!=null?"gu":"g",gIe=new RegExp(`[\0-\b
|
|
439
|
-
--\u2028\u2029\uFEFF-]`,bO),yIe={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let m1=null;function vIe(){var e;if(m1==null&&typeof document<"u"&&document.body){let t=document.body.style;m1=((e=t.tabSize)!==null&&e!==void 0?e:t.MozTabSize)!=null}return m1||!1}const ig=se.define({combine(e){let t=Ji(e,{render:null,specialChars:gIe,addSpecialChars:null});return(t.replaceTabs=!vIe())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,bO)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,bO)),t}});function bIe(e={}){return[ig.of(e),xIe()]}let OR=null;function xIe(){return OR||(OR=Et.fromClass(class{constructor(e){this.view=e,this.decorations=de.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(ig)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new mIe({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:i}=n.state,o=zn(t[0],0);if(o==9){let s=i.lineAt(r),a=n.state.tabSize,l=qc(s.text,a,r-s.from);return de.replace({widget:new OIe((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=de.replace({widget:new kIe(e,o)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(ig);e.startState.facet(ig)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))}const wIe="•";function SIe(e){return e>=32?wIe:e==10?"":String.fromCharCode(9216+e)}class kIe extends eo{constructor(t,n){super(),this.options=t,this.code=n}eq(t){return t.code==this.code}toDOM(t){let n=SIe(this.code),r=t.state.phrase("Control character")+" "+(yIe[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let o=document.createElement("span");return o.textContent=n,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class OIe extends eo{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent=" ",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}function CIe(){return PIe}const AIe=de.line({class:"cm-activeLine"}),PIe=Et.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(AIe.range(i.from)),t=i.from)}return de.set(n)}},{decorations:e=>e.decorations});class EIe extends eo{constructor(t){super(),this.content=t}toDOM(t){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(t):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(t){let n=t.firstChild?ch(t.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(t.parentNode),i=Id(n[0],r.direction!="rtl"),o=parseInt(r.lineHeight);return i.bottom-i.top>o*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+o}:i}ignoreEvent(){return!1}}function TIe(e){let t=Et.fromClass(class{constructor(n){this.view=n,this.placeholder=e?de.set([de.widget({widget:new EIe(e),side:1}).range(0)]):de.none}get decorations(){return this.view.state.doc.length?de.none:this.placeholder}},{decorations:n=>n.decorations});return typeof e=="string"?[t,ie.contentAttributes.of({"aria-placeholder":e})]:t}const xO=2e3;function _Ie(e,t,n){let r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),o=[];if(t.off>xO||n.off>xO||t.col<0||n.col<0){let s=Math.min(t.off,n.off),a=Math.max(t.off,n.off);for(let l=r;l<=i;l++){let u=e.doc.line(l);u.length<=a&&o.push(V.range(u.from+s,u.to+a))}}else{let s=Math.min(t.col,n.col),a=Math.max(t.col,n.col);for(let l=r;l<=i;l++){let u=e.doc.line(l),c=Jk(u.text,s,e.tabSize,!0);if(c<0)o.push(V.cursor(u.to));else{let f=Jk(u.text,a,e.tabSize);o.push(V.range(u.from+c,u.from+f))}}}return o}function jIe(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function CR(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),r=e.state.doc.lineAt(n),i=n-r.from,o=i>xO?-1:i==r.length?jIe(e,t.clientX):qc(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:o,off:i}}function MIe(e,t){let n=CR(e,t),r=e.state.selection;return n?{update(i){if(i.docChanged){let o=i.changes.mapPos(i.startState.doc.line(n.line).from),s=i.state.doc.lineAt(o);n={line:s.number,col:n.col,off:Math.min(n.off,s.length)},r=r.map(i.changes)}},get(i,o,s){let a=CR(e,i);if(!a)return r;let l=_Ie(e.state,n,a);return l.length?s?V.create(l.concat(r.ranges)):V.create(l):r}}:null}function IIe(e){let t=n=>n.altKey&&n.button==0;return ie.mouseSelectionStyle.of((n,r)=>t(r)?MIe(n,r):null)}const NIe={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},RIe={style:"cursor: crosshair"};function DIe(e={}){let[t,n]=NIe[e.key||"Alt"],r=Et.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==t||n(i))},keyup(i){(i.keyCode==t||!n(i))&&this.set(!1)},mousemove(i){this.set(n(i))}}});return[r,ie.contentAttributes.of(i=>{var o;return!((o=i.plugin(r))===null||o===void 0)&&o.isDown?RIe:null})]}const bm="-10000px";class k9{constructor(t,n,r,i){this.facet=n,this.createTooltipView=r,this.removeTooltipView=i,this.input=t.state.facet(n),this.tooltips=this.input.filter(s=>s);let o=null;this.tooltipViews=this.tooltips.map(s=>o=r(s,o))}update(t,n){var r;let i=t.state.facet(this.facet),o=i.filter(l=>l);if(i===this.input){for(let l of this.tooltipViews)l.update&&l.update(t);return!1}let s=[],a=n?[]:null;for(let l=0;l<o.length;l++){let u=o[l],c=-1;if(u){for(let f=0;f<this.tooltips.length;f++){let h=this.tooltips[f];h&&h.create==u.create&&(c=f)}if(c<0)s[l]=this.createTooltipView(u,l?s[l-1]:null),a&&(a[l]=!!u.above);else{let f=s[l]=this.tooltipViews[c];a&&(a[l]=n[c]),f.update&&f.update(t)}}}for(let l of this.tooltipViews)s.indexOf(l)<0&&(this.removeTooltipView(l),(r=l.destroy)===null||r===void 0||r.call(l));return n&&(a.forEach((l,u)=>n[u]=l),n.length=a.length),this.input=i,this.tooltips=o,this.tooltipViews=s,!0}}function LIe(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const g1=se.define({combine:e=>{var t,n,r;return{position:oe.ios?"absolute":((t=e.find(i=>i.position))===null||t===void 0?void 0:t.position)||"fixed",parent:((n=e.find(i=>i.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=e.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||LIe}}}),AR=new WeakMap,HP=Et.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(g1);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new k9(e,VP,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(g1);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",n.dom.appendChild(i)}return n.dom.style.position=this.position,n.dom.style.top=bm,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(e=r.destroy)===null||e===void 0||e.call(r);this.parent&&this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:o}=this.manager.tooltipViews[0];if(oe.safari){let s=o.getBoundingClientRect();n=Math.abs(s.top+1e4)>1||Math.abs(s.left)>1}else n=!!o.offsetParent&&o.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let o=this.parent.getBoundingClientRect();o.width&&o.height&&(e=o.width/this.parent.offsetWidth,t=o.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=FP(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((o,s)=>{let a=this.manager.tooltipViews[s];return a.getCoords?a.getCoords(o.pos):this.view.coordsAtPos(o.pos)}),size:this.manager.tooltipViews.map(({dom:o})=>o.getBoundingClientRect()),space:this.view.state.facet(g1).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{visible:n,space:r,scaleX:i,scaleY:o}=e,s=[];for(let a=0;a<this.manager.tooltips.length;a++){let l=this.manager.tooltips[a],u=this.manager.tooltipViews[a],{dom:c}=u,f=e.pos[a],h=e.size[a];if(!f||l.clip!==!1&&(f.bottom<=Math.max(n.top,r.top)||f.top>=Math.min(n.bottom,r.bottom)||f.right<Math.max(n.left,r.left)-.1||f.left>Math.min(n.right,r.right)+.1)){c.style.top=bm;continue}let d=l.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,m=h.right-h.left,v=(t=AR.get(u))!==null&&t!==void 0?t:h.bottom-h.top,b=u.offset||BIe,y=this.view.textDirection==Je.LTR,x=h.width>r.right-r.left?y?r.left:r.right-h.width:y?Math.max(r.left,Math.min(f.left-(d?14:0)+b.x,r.right-m)):Math.min(Math.max(r.left,f.left-m+(d?14:0)-b.x),r.right-m),k=this.above[a];!l.strictSide&&(k?f.top-v-p-b.y<r.top:f.bottom+v+p+b.y>r.bottom)&&k==r.bottom-f.bottom>f.top-r.top&&(k=this.above[a]=!k);let w=(k?f.top-r.top:r.bottom-f.bottom)-p;if(w<v&&u.resize!==!1){if(w<this.view.defaultLineHeight){c.style.top=bm;continue}AR.set(u,v),c.style.height=(v=w)/o+"px"}else c.style.height&&(c.style.height="");let S=k?f.top-v-p-b.y:f.bottom+p+b.y,O=x+m;if(u.overlap!==!0)for(let A of s)A.left<O&&A.right>x&&A.top<S+v&&A.bottom>S&&(S=k?A.top-v-2-p:A.bottom+p+2);if(this.position=="absolute"?(c.style.top=(S-e.parent.top)/o+"px",PR(c,(x-e.parent.left)/i)):(c.style.top=S/o+"px",PR(c,x/i)),d){let A=f.left+(y?b.x:-b.x)-(x+14-7);d.style.left=A/i+"px"}u.overlap!==!0&&s.push({left:x,top:S,right:O,bottom:S+v}),c.classList.toggle("cm-tooltip-above",k),c.classList.toggle("cm-tooltip-below",!k),u.positioned&&u.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=bm}},{eventObservers:{scroll(){this.maybeMeasure()}}});function PR(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const $Ie=ie.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),BIe={x:0,y:0},VP=se.define({enables:[HP,$Ie]}),hv=se.define({combine:e=>e.reduce((t,n)=>t.concat(n),[])});class hb{static create(t){return new hb(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new k9(t,hv,(n,r)=>this.createHostedView(n,r),n=>n.dom.remove())}createHostedView(t,n){let r=t.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(t){for(let n of this.manager.tooltipViews)n.mount&&n.mount(t);this.mounted=!0}positioned(t){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(t)}update(t){this.manager.update(t)}destroy(){var t;for(let n of this.manager.tooltipViews)(t=n.destroy)===null||t===void 0||t.call(n)}passProp(t){let n;for(let r of this.manager.tooltipViews){let i=r[t];if(i!==void 0){if(n===void 0)n=i;else if(n!==i)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const FIe=VP.compute([hv],e=>{let t=e.facet(hv);return t.length===0?null:{pos:Math.min(...t.map(n=>n.pos)),end:Math.max(...t.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:hb.create,above:t[0].above,arrow:t.some(n=>n.arrow)}});class zIe{constructor(t,n,r,i,o){this.view=t,this.source=n,this.field=r,this.setHover=i,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let t=Date.now()-this.lastMove.time;t<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-t):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:t,lastMove:n}=this,r=t.docView.tile.nearest(n.target);if(!r)return;let i,o=1;if(r.isWidget())i=r.posAtStart;else{if(i=t.posAtCoords(n),i==null)return;let a=t.coordsAtPos(i);if(!a||n.y<a.top||n.y>a.bottom||n.x<a.left-t.defaultCharacterWidth||n.x>a.right+t.defaultCharacterWidth)return;let l=t.bidiSpans(t.state.doc.lineAt(i)).find(c=>c.from<=i&&c.to>=i),u=l&&l.dir==Je.RTL?-1:1;o=n.x<a.left?-u:u}let s=this.source(t,i,o);if(s?.then){let a=this.pending={pos:i};s.then(l=>{this.pending==a&&(this.pending=null,l&&!(Array.isArray(l)&&!l.length)&&t.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])}))},l=>Gn(t.state,l,"hover tooltip"))}else s&&!(Array.isArray(s)&&!s.length)&&t.dispatch({effects:this.setHover.of(Array.isArray(s)?s:[s])})}get tooltip(){let t=this.view.plugin(HP),n=t?t.manager.tooltips.findIndex(r=>r.create==hb.create):-1;return n>-1?t.manager.tooltipViews[n]:null}mousemove(t){var n,r;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:o}=this;if(i.length&&o&&!WIe(o.dom,t)||this.pending){let{pos:s}=i[0]||this.pending,a=(r=(n=i[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:s;(s==a?this.view.posAtCoords(this.lastMove)!=s:!UIe(this.view,s,a,t.clientX,t.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length){let{tooltip:r}=this;r&&r.dom.contains(t.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(t){let n=r=>{t.removeEventListener("mouseleave",n),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};t.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const xm=4;function WIe(e,t){let{left:n,right:r,top:i,bottom:o}=e.getBoundingClientRect(),s;if(s=e.querySelector(".cm-tooltip-arrow")){let a=s.getBoundingClientRect();i=Math.min(a.top,i),o=Math.max(a.bottom,o)}return t.clientX>=n-xm&&t.clientX<=r+xm&&t.clientY>=i-xm&&t.clientY<=o+xm}function UIe(e,t,n,r,i,o){let s=e.scrollDOM.getBoundingClientRect(),a=e.documentTop+e.documentPadding.top+e.contentHeight;if(s.left>r||s.right<r||s.top>i||Math.min(s.bottom,a)<i)return!1;let l=e.posAtCoords({x:r,y:i},!1);return l>=t&&l<=n}function HIe(e,t={}){let n=ke.define(),r=kn.define({create(){return[]},update(i,o){if(i.length&&(t.hideOnChange&&(o.docChanged||o.selection)?i=[]:t.hideOn&&(i=i.filter(s=>!t.hideOn(o,s))),o.docChanged)){let s=[];for(let a of i){let l=o.changes.mapPos(a.pos,-1,jn.TrackDel);if(l!=null){let u=Object.assign(Object.create(null),a);u.pos=l,u.end!=null&&(u.end=o.changes.mapPos(u.end)),s.push(u)}}i=s}for(let s of o.effects)s.is(n)&&(i=s.value),s.is(VIe)&&(i=[]);return i},provide:i=>hv.from(i)});return{active:r,extension:[r,Et.define(i=>new zIe(i,e,r,n,t.hoverTime||300)),FIe]}}function O9(e,t){let n=e.plugin(HP);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}const VIe=ke.define(),ER=se.define({combine(e){let t,n;for(let r of e)t=t||r.topContainer,n=n||r.bottomContainer;return{topContainer:t,bottomContainer:n}}});function qP(e,t){let n=e.plugin(C9),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}const C9=Et.fromClass(class{constructor(e){this.input=e.state.facet(Rd),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(e));let t=e.state.facet(ER);this.top=new wm(e,!0,t.topContainer),this.bottom=new wm(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(ER);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new wm(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new wm(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(Rd);if(n!=this.input){let r=n.filter(l=>l),i=[],o=[],s=[],a=[];for(let l of r){let u=this.specs.indexOf(l),c;u<0?(c=l(e.view),a.push(c)):(c=this.panels[u],c.update&&c.update(e)),i.push(c),(c.top?o:s).push(c)}this.specs=r,this.panels=i,this.top.sync(o),this.bottom.sync(s);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let r of this.panels)r.update&&r.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>ie.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class wm{constructor(t,n,r){this.view=t,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let n of this.panels)n.destroy&&t.indexOf(n)<0&&n.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let t=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;t!=n.dom;)t=TR(t);t=t.nextSibling}else this.dom.insertBefore(n.dom,t);for(;t;)t=TR(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function TR(e){let t=e.nextSibling;return e.remove(),t}const Rd=se.define({enables:C9});function qIe(e,t){let n,r=new Promise(s=>n=s),i=s=>KIe(s,t,n);e.state.field(y1,!1)?e.dispatch({effects:A9.of(i)}):e.dispatch({effects:ke.appendConfig.of(y1.init(()=>[i]))});let o=P9.of(i);return{close:o,result:r.then(s=>((e.win.queueMicrotask||(l=>e.win.setTimeout(l,10)))(()=>{e.state.field(y1).indexOf(i)>-1&&e.dispatch({effects:o})}),s))}}const y1=kn.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(A9)?e=[n.value].concat(e):n.is(P9)&&(e=e.filter(r=>r!=n.value));return e},provide:e=>Rd.computeN([e],t=>t.field(e))}),A9=ke.define(),P9=ke.define();function KIe(e,t,n){let r=t.content?t.content(e,()=>s(null)):null;if(!r){if(r=Ke("form"),t.input){let a=Ke("input",t.input);/^(text|password|number|email|tel|url)$/.test(a.type)&&a.classList.add("cm-textfield"),a.name||(a.name="input"),r.appendChild(Ke("label",(t.label||"")+": ",a))}else r.appendChild(document.createTextNode(t.label||""));r.appendChild(document.createTextNode(" ")),r.appendChild(Ke("button",{class:"cm-button",type:"submit"},t.submitLabel||"OK"))}let i=r.nodeName=="FORM"?[r]:r.querySelectorAll("form");for(let a=0;a<i.length;a++){let l=i[a];l.addEventListener("keydown",u=>{u.keyCode==27?(u.preventDefault(),s(null)):u.keyCode==13&&(u.preventDefault(),s(l))}),l.addEventListener("submit",u=>{u.preventDefault(),s(l)})}let o=Ke("div",r,Ke("button",{onclick:()=>s(null),"aria-label":e.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));t.class&&(o.className=t.class),o.classList.add("cm-dialog");function s(a){o.contains(o.ownerDocument.activeElement)&&e.focus(),n(a)}return{dom:o,top:t.top,mount:()=>{if(t.focus){let a;typeof t.focus=="string"?a=r.querySelector(t.focus):a=r.querySelector("input")||r.querySelector("button"),a&&"select"in a?a.select():a&&"focus"in a&&a.focus()}}}}class Ro extends js{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}Ro.prototype.elementClass="";Ro.prototype.toDOM=void 0;Ro.prototype.mapMode=jn.TrackBefore;Ro.prototype.startSide=Ro.prototype.endSide=-1;Ro.prototype.point=!0;const og=se.define(),GIe=se.define(),QIe={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>_e.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},dh=se.define();function XIe(e){return[E9(),dh.of({...QIe,...e})]}const _R=se.define({combine:e=>e.some(t=>t)});function E9(e){return[YIe]}const YIe=Et.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(dh).map(t=>new MR(e,t)),this.fixed=!e.state.facet(_R);for(let t of this.gutters)t.config.side=="after"?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(e.geometryChanged){let t=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=t,this.domAfter&&(this.domAfter.style.minHeight=t)}this.view.state.facet(_R)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=_e.iter(this.view.state.facet(og),this.view.viewport.from),r=[],i=this.gutters.map(o=>new ZIe(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(o.type)){let s=!0;for(let a of o.type)if(a.type==fn.Text&&s){wO(n,r,a.from);for(let l of i)l.line(this.view,a,r);s=!1}else if(a.widget)for(let l of i)l.widget(this.view,a)}else if(o.type==fn.Text){wO(n,r,o.from);for(let s of i)s.line(this.view,o,r)}else if(o.widget)for(let s of i)s.widget(this.view,o);for(let o of i)o.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(dh),n=e.state.facet(dh),r=e.docChanged||e.heightChanged||e.viewportChanged||!_e.eq(e.startState.facet(og),e.state.facet(og),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let i of this.gutters)i.update(e)&&(r=!0);else{r=!0;let i=[];for(let o of n){let s=t.indexOf(o);s<0?i.push(new MR(this.view,o)):(this.gutters[s].update(e),i.push(this.gutters[s]))}for(let o of this.gutters)o.dom.remove(),i.indexOf(o)<0&&o.destroy();for(let o of i)o.config.side=="after"?this.getDOMAfter().appendChild(o.dom):this.dom.appendChild(o.dom);this.gutters=i}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>ie.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*t.scaleX,i=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==Je.LTR?{left:r,right:i}:{right:r,left:i}})});function jR(e){return Array.isArray(e)?e:[e]}function wO(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class ZIe{constructor(t,n,r){this.gutter=t,this.height=r,this.i=0,this.cursor=_e.iter(t.markers,n.from)}addElement(t,n,r){let{gutter:i}=this,o=(n.top-this.height)/t.scaleY,s=n.height/t.scaleY;if(this.i==i.elements.length){let a=new T9(t,s,o,r);i.elements.push(a),i.dom.appendChild(a.dom)}else i.elements[this.i].update(t,s,o,r);this.height=n.bottom,this.i++}line(t,n,r){let i=[];wO(this.cursor,i,n.from),r.length&&(i=i.concat(r));let o=this.gutter.config.lineMarker(t,n,i);o&&i.unshift(o);let s=this.gutter;i.length==0&&!s.config.renderEmptyElements||this.addElement(t,n,i)}widget(t,n){let r=this.gutter.config.widgetMarker(t,n.widget,n),i=r?[r]:null;for(let o of t.state.facet(GIe)){let s=o(t,n.widget,n);s&&(i||(i=[])).push(s)}i&&this.addElement(t,n,i)}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let n=t.elements.pop();t.dom.removeChild(n.dom),n.destroy()}}}class MR{constructor(t,n){this.view=t,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let o=i.target,s;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let l=o.getBoundingClientRect();s=(l.top+l.bottom)/2}else s=i.clientY;let a=t.lineBlockAtHeight(s-t.documentTop);n.domEventHandlers[r](t,a,i)&&i.preventDefault()});this.markers=jR(n.markers(t)),n.initialSpacer&&(this.spacer=new T9(t,0,0,[n.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let n=this.markers;if(this.markers=jR(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],t);i!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[i])}let r=t.view.viewport;return!_e.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(t):!1)}destroy(){for(let t of this.elements)t.destroy()}}class T9{constructor(t,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,n,r,i)}update(t,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),JIe(this.markers,i)||this.setMarkers(t,i)}setMarkers(t,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let o=0,s=0;;){let a=s,l=o<n.length?n[o++]:null,u=!1;if(l){let c=l.elementClass;c&&(r+=" "+c);for(let f=s;f<this.markers.length;f++)if(this.markers[f].compare(l)){a=f,u=!0;break}}else a=this.markers.length;for(;s<a;){let c=this.markers[s++];if(c.toDOM){c.destroy(i);let f=i.nextSibling;i.remove(),i=f}}if(!l)break;l.toDOM&&(u?i=i.nextSibling:this.dom.insertBefore(l.toDOM(t),i)),u&&s++}this.dom.className=r,this.markers=n}destroy(){this.setMarkers(null,[])}}function JIe(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}const eNe=se.define(),tNe=se.define(),lu=se.define({combine(e){return Ji(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(t,n){let r=Object.assign({},t);for(let i in n){let o=r[i],s=n[i];r[i]=o?(a,l,u)=>o(a,l,u)||s(a,l,u):s}return r}})}});class v1 extends Ro{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function b1(e,t){return e.state.facet(lu).formatNumber(t,e.state)}const nNe=dh.compute([lu],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(t){return t.state.facet(eNe)},lineMarker(t,n,r){return r.some(i=>i.toDOM)?null:new v1(b1(t,t.state.doc.lineAt(n.from).number))},widgetMarker:(t,n,r)=>{for(let i of t.state.facet(tNe)){let o=i(t,n,r);if(o)return o}return null},lineMarkerChange:t=>t.startState.facet(lu)!=t.state.facet(lu),initialSpacer(t){return new v1(b1(t,IR(t.state.doc.lines)))},updateSpacer(t,n){let r=b1(n.view,IR(n.view.state.doc.lines));return r==t.number?t:new v1(r)},domEventHandlers:e.facet(lu).domEventHandlers,side:"before"}));function rNe(e={}){return[lu.of(e),E9(),nNe]}function IR(e){let t=9;for(;t<e;)t=t*10+9;return t}const iNe=new class extends Ro{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},oNe=og.compute(["selection"],e=>{let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.head).from;i>n&&(n=i,t.push(iNe.range(i)))}return _e.of(t)});function sNe(){return oNe}const _9=1024;let aNe=0;class x1{constructor(t,n){this.from=t,this.to=n}}class Te{constructor(t={}){this.id=aNe++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=nr.match(t)),n=>{let r=t(n);return r===void 0?null:[this,r]}}}Te.closedBy=new Te({deserialize:e=>e.split(" ")});Te.openedBy=new Te({deserialize:e=>e.split(" ")});Te.group=new Te({deserialize:e=>e.split(" ")});Te.isolate=new Te({deserialize:e=>{if(e&&e!="rtl"&&e!="ltr"&&e!="auto")throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}});Te.contextHash=new Te({perNode:!0});Te.lookAhead=new Te({perNode:!0});Te.mounted=new Te({perNode:!0});class ph{constructor(t,n,r,i=!1){this.tree=t,this.overlay=n,this.parser=r,this.bracketed=i}static get(t){return t&&t.props&&t.props[Te.mounted.id]}}const lNe=Object.create(null);class nr{constructor(t,n,r,i=0){this.name=t,this.props=n,this.id=r,this.flags=i}static define(t){let n=t.props&&t.props.length?Object.create(null):lNe,r=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new nr(t.name||"",n,t.id,r);if(t.props){for(let o of t.props)if(Array.isArray(o)||(o=o(i)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[o[0].id]=o[1]}}return i}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let n=this.prop(Te.group);return n?n.indexOf(t)>-1:!1}return this.id==t}static match(t){let n=Object.create(null);for(let r in t)for(let i of r.split(" "))n[i]=t[r];return r=>{for(let i=r.prop(Te.group),o=-1;o<(i?i.length:0);o++){let s=n[o<0?r.name:i[o]];if(s)return s}}}}nr.none=new nr("",Object.create(null),0,8);class KP{constructor(t){this.types=t;for(let n=0;n<t.length;n++)if(t[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...t){let n=[];for(let r of this.types){let i=null;for(let o of t){let s=o(r);if(s){i||(i=Object.assign({},r.props));let a=s[1],l=s[0];l.combine&&l.id in i&&(a=l.combine(i[l.id],a)),i[l.id]=a}}n.push(i?new nr(r.name,i,r.id,r.flags):r)}return new KP(n)}}const Sm=new WeakMap,NR=new WeakMap;var At;(function(e){e[e.ExcludeBuffers=1]="ExcludeBuffers",e[e.IncludeAnonymous=2]="IncludeAnonymous",e[e.IgnoreMounts=4]="IgnoreMounts",e[e.IgnoreOverlays=8]="IgnoreOverlays",e[e.EnterBracketed=16]="EnterBracketed"})(At||(At={}));class jt{constructor(t,n,r,i,o){if(this.type=t,this.children=n,this.positions=r,this.length=i,this.props=null,o&&o.length){this.props=Object.create(null);for(let[s,a]of o)this.props[typeof s=="number"?s:s.id]=a}}toString(){let t=ph.get(this);if(t&&!t.overlay)return t.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(t=0){return new kO(this.topNode,t)}cursorAt(t,n=0,r=0){let i=Sm.get(this)||this.topNode,o=new kO(i);return o.moveTo(t,n),Sm.set(this,o._tree),o}get topNode(){return new Vr(this,0,0,null)}resolve(t,n=0){let r=Dd(Sm.get(this)||this.topNode,t,n,!1);return Sm.set(this,r),r}resolveInner(t,n=0){let r=Dd(NR.get(this)||this.topNode,t,n,!0);return NR.set(this,r),r}resolveStack(t,n=0){return fNe(this,t,n)}iterate(t){let{enter:n,leave:r,from:i=0,to:o=this.length}=t,s=t.mode||0,a=(s&At.IncludeAnonymous)>0;for(let l=this.cursor(s|At.IncludeAnonymous);;){let u=!1;if(l.from<=o&&l.to>=i&&(!a&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;u=!0}for(;u&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;u=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let n in this.props)t.push([+n,this.props[n]]);return t}balance(t={}){return this.children.length<=8?this:XP(nr.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new jt(this.type,n,r,i,this.propValues),t.makeTree||((n,r,i)=>new jt(nr.none,n,r,i)))}static build(t){return hNe(t)}}jt.empty=new jt(nr.none,[],[],0);class GP{constructor(t,n){this.buffer=t,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new GP(this.buffer,this.index)}}class Rs{constructor(t,n,r){this.buffer=t,this.length=n,this.set=r}get type(){return nr.none}toString(){let t=[];for(let n=0;n<this.buffer.length;)t.push(this.childString(n)),n=this.buffer[n+3];return t.join(",")}childString(t){let n=this.buffer[t],r=this.buffer[t+3],i=this.set.types[n],o=i.name;if(/\W/.test(o)&&!i.isError&&(o=JSON.stringify(o)),t+=4,r==t)return o;let s=[];for(;t<r;)s.push(this.childString(t)),t=this.buffer[t+3];return o+"("+s.join(",")+")"}findChild(t,n,r,i,o){let{buffer:s}=this,a=-1;for(let l=t;l!=n&&!(j9(o,i,s[l+1],s[l+2])&&(a=l,r>0));l=s[l+3]);return a}slice(t,n,r){let i=this.buffer,o=new Uint16Array(n-t),s=0;for(let a=t,l=0;a<n;){o[l++]=i[a++],o[l++]=i[a++]-r;let u=o[l++]=i[a++]-r;o[l++]=i[a++]-t,s=Math.max(s,u)}return new Rs(o,s,this.set)}}function j9(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function Dd(e,t,n,r){for(var i;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let s=!r&&e instanceof Vr&&e.index<0?null:e.parent;if(!s)return e;e=s}let o=r?0:At.IgnoreOverlays;if(r)for(let s=e,a=s.parent;a;s=a,a=s.parent)s instanceof Vr&&s.index<0&&((i=a.enter(t,n,o))===null||i===void 0?void 0:i.from)!=s.from&&(e=a);for(;;){let s=e.enter(t,n,o);if(!s)return e;e=s}}class M9{cursor(t=0){return new kO(this,t)}getChild(t,n=null,r=null){let i=RR(this,t,n,r);return i.length?i[0]:null}getChildren(t,n=null,r=null){return RR(this,t,n,r)}resolve(t,n=0){return Dd(this,t,n,!1)}resolveInner(t,n=0){return Dd(this,t,n,!0)}matchContext(t){return SO(this.parent,t)}enterUnfinishedNodesBefore(t){let n=this.childBefore(t),r=this;for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(r=n,n=i.prevSibling):n=i}return r}get node(){return this}get next(){return this.parent}}class Vr extends M9{constructor(t,n,r,i){super(),this._tree=t,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,o=0){for(let s=this;;){for(let{children:a,positions:l}=s._tree,u=n>0?a.length:-1;t!=u;t+=n){let c=a[t],f=l[t]+s.from,h;if(!(!(o&At.EnterBracketed&&c instanceof jt&&(h=ph.get(c))&&!h.overlay&&h.bracketed&&r>=f&&r<=f+c.length)&&!j9(i,r,f,f+c.length))){if(c instanceof Rs){if(o&At.ExcludeBuffers)continue;let d=c.findChild(0,c.buffer.length,n,r-f,i);if(d>-1)return new cs(new uNe(s,c,t,f),null,d)}else if(o&At.IncludeAnonymous||!c.type.isAnonymous||QP(c)){let d;if(!(o&At.IgnoreMounts)&&(d=ph.get(c))&&!d.overlay)return new Vr(d.tree,f,t,s);let p=new Vr(c,f,t,s);return o&At.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(n<0?c.children.length-1:0,n,r,i,o)}}}if(o&At.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?t=s.index+n:t=n<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}prop(t){return this._tree.prop(t)}enter(t,n,r=0){let i;if(!(r&At.IgnoreOverlays)&&(i=ph.get(this._tree))&&i.overlay){let o=t-this.from,s=r&At.EnterBracketed&&i.bracketed;for(let{from:a,to:l}of i.overlay)if((n>0||s?a<=o:a<o)&&(n<0||s?l>=o:l>o))return new Vr(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function RR(e,t,n,r){let i=e.cursor(),o=[];if(!i.firstChild())return o;if(n!=null){for(let s=!1;!s;)if(s=i.type.is(n),!i.nextSibling())return o}for(;;){if(r!=null&&i.type.is(r))return o;if(i.type.is(t)&&o.push(i.node),!i.nextSibling())return r==null?o:[]}}function SO(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}class uNe{constructor(t,n,r,i){this.parent=t,this.buffer=n,this.index=r,this.start=i}}class cs extends M9{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,n,r){super(),this.context=t,this._parent=n,this.index=r,this.type=t.buffer.set.types[t.buffer.buffer[r]]}child(t,n,r){let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return o<0?null:new cs(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}prop(t){return this.type.prop(t)}enter(t,n,r=0){if(r&At.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return o<0?null:new cs(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new cs(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new cs(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],n=[],{buffer:r}=this.context,i=this.index+4,o=r.buffer[this.index+3];if(o>i){let s=r.buffer[this.index+1];t.push(r.slice(i,o,s)),n.push(0)}return new jt(this.type,t,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function I9(e){if(!e.length)return null;let t=0,n=e[0];for(let o=1;o<e.length;o++){let s=e[o];(s.from>n.from||s.to<n.to)&&(n=s,t=o)}let r=n instanceof Vr&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new cNe(i,n)}class cNe{constructor(t,n){this.heads=t,this.node=n}get next(){return I9(this.heads)}}function fNe(e,t,n){let r=e.resolveInner(t,n),i=null;for(let o=r instanceof Vr?r:r.context.parent;o;o=o.parent)if(o.index<0){let s=o.parent;(i||(i=[r])).push(s.resolve(t,n)),o=s}else{let s=ph.get(o.tree);if(s&&s.overlay&&s.overlay[0].from<=t&&s.overlay[s.overlay.length-1].to>=t){let a=new Vr(s.tree,s.overlay[0].from+o.from,-1,o);(i||(i=[r])).push(Dd(a,t,n,!1))}}return i?I9(i):r}class kO{get name(){return this.type.name}constructor(t,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~At.EnterBracketed,t instanceof Vr)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let r=t._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,n){this.index=t;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[t]],this.from=r+i.buffer[t+1],this.to=r+i.buffer[t+2],!0}yield(t){return t?t instanceof Vr?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,n,r,this.mode));let{buffer:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.buffer.start,r);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,n,r=this.mode){return this.buffer?r&At.ExcludeBuffers?!1:this.enterChild(1,t,n):this.yield(this._tree.enter(t,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&At.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&At.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(t<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let n,r,{buffer:i}=this;if(i){if(t>0){if(this.index<i.buffer.buffer.length)return!1}else for(let o=0;o<this.index;o++)if(i.buffer.buffer[o+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let o=n+t,s=t<0?-1:r._tree.children.length;o!=s;o+=t){let a=r._tree.children[o];if(this.mode&At.IncludeAnonymous||a instanceof Rs||!a.type.isAnonymous||QP(a))return!1}return!0}move(t,n){if(n&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,n=0){for(;(this.from==this.to||(n<1?this.from>=t:this.from>t)||(n>-1?this.to<=t:this.to<t))&&this.parent(););for(;this.enterChild(1,t,n););return this}get node(){if(!this.buffer)return this._tree;let t=this.bufferNode,n=null,r=0;if(t&&t.context==this.buffer)e:for(let i=this.index,o=this.stack.length;o>=0;){for(let s=t;s;s=s._parent)if(s.index==i){if(i==this.index)return s;n=s,r=o+1;break e}i=this.stack[--o]}for(let i=r;i<this.stack.length;i++)n=new cs(this.buffer,n,this.stack[i]);return this.bufferNode=new cs(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(t,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||t(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&n&&n(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(t){if(!this.buffer)return SO(this.node.parent,t);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=t.length-1,o=this.stack.length-1;i>=0;o--){if(o<0)return SO(this._tree,t,i);let s=r[n.buffer[this.stack[o]]];if(!s.isAnonymous){if(t[i]&&t[i]!=s.name)return!1;i--}}return!0}}function QP(e){return e.children.some(t=>t instanceof Rs||!t.type.isAnonymous||QP(t))}function hNe(e){var t;let{buffer:n,nodeSet:r,maxBufferLength:i=_9,reused:o=[],minRepeatType:s=r.types.length}=e,a=Array.isArray(n)?new GP(n,n.length):n,l=r.types,u=0,c=0;function f(w,S,O,A,P,M){let{id:j,start:E,end:D,size:R}=a,N=c,B=u;if(R<0)if(a.next(),R==-1){let q=o[j];O.push(q),A.push(E-w);return}else if(R==-3){u=j;return}else if(R==-4){c=j;return}else throw new RangeError(`Unrecognized record size: ${R}`);let F=l[j],$,z,T=E-w;if(D-E<=i&&(z=v(a.pos-S,P))){let q=new Uint16Array(z.size-z.skip),I=a.pos-z.size,_=q.length;for(;a.pos>I;)_=b(z.start,q,_);$=new Rs(q,D-z.start,r),T=z.start-w}else{let q=a.pos-R;a.next();let I=[],_=[],K=j>=s?j:-1,Q=0,te=D;for(;a.pos>q;)K>=0&&a.id==K&&a.size>=0?(a.end<=te-i&&(p(I,_,E,Q,a.end,te,K,N,B),Q=I.length,te=a.end),a.next()):M>2500?h(E,q,I,_):f(E,q,I,_,K,M+1);if(K>=0&&Q>0&&Q<I.length&&p(I,_,E,Q,E,te,K,N,B),I.reverse(),_.reverse(),K>-1&&Q>0){let he=d(F,B);$=XP(F,I,_,0,I.length,0,D-E,he,he)}else $=m(F,I,_,D-E,N-D,B)}O.push($),A.push(T)}function h(w,S,O,A){let P=[],M=0,j=-1;for(;a.pos>S;){let{id:E,start:D,end:R,size:N}=a;if(N>4)a.next();else{if(j>-1&&D<j)break;j<0&&(j=R-i),P.push(E,D,R),M++,a.next()}}if(M){let E=new Uint16Array(M*4),D=P[P.length-2];for(let R=P.length-3,N=0;R>=0;R-=3)E[N++]=P[R],E[N++]=P[R+1]-D,E[N++]=P[R+2]-D,E[N++]=N;O.push(new Rs(E,P[2]-D,r)),A.push(D-w)}}function d(w,S){return(O,A,P)=>{let M=0,j=O.length-1,E,D;if(j>=0&&(E=O[j])instanceof jt){if(!j&&E.type==w&&E.length==P)return E;(D=E.prop(Te.lookAhead))&&(M=A[j]+E.length+D)}return m(w,O,A,P,M,S)}}function p(w,S,O,A,P,M,j,E,D){let R=[],N=[];for(;w.length>A;)R.push(w.pop()),N.push(S.pop()+O-P);w.push(m(r.types[j],R,N,M-P,E-M,D)),S.push(P-O)}function m(w,S,O,A,P,M,j){if(M){let E=[Te.contextHash,M];j=j?[E].concat(j):[E]}if(P>25){let E=[Te.lookAhead,P];j=j?[E].concat(j):[E]}return new jt(w,S,O,A,j)}function v(w,S){let O=a.fork(),A=0,P=0,M=0,j=O.end-i,E={size:0,start:0,skip:0};e:for(let D=O.pos-w;O.pos>D;){let R=O.size;if(O.id==S&&R>=0){E.size=A,E.start=P,E.skip=M,M+=4,A+=4,O.next();continue}let N=O.pos-R;if(R<0||N<D||O.start<j)break;let B=O.id>=s?4:0,F=O.start;for(O.next();O.pos>N;){if(O.size<0)if(O.size==-3||O.size==-4)B+=4;else break e;else O.id>=s&&(B+=4);O.next()}P=F,A+=R,M+=B}return(S<0||A==w)&&(E.size=A,E.start=P,E.skip=M),E.size>4?E:void 0}function b(w,S,O){let{id:A,start:P,end:M,size:j}=a;if(a.next(),j>=0&&A<s){let E=O;if(j>4){let D=a.pos-(j-4);for(;a.pos>D;)O=b(w,S,O)}S[--O]=E,S[--O]=M-w,S[--O]=P-w,S[--O]=A}else j==-3?u=A:j==-4&&(c=A);return O}let y=[],x=[];for(;a.pos>0;)f(e.start||0,e.bufferStart||0,y,x,-1,0);let k=(t=e.length)!==null&&t!==void 0?t:y.length?x[0]+y[0].length:0;return new jt(l[e.topID],y.reverse(),x.reverse(),k)}const DR=new WeakMap;function sg(e,t){if(!e.isAnonymous||t instanceof Rs||t.type!=e)return 1;let n=DR.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof jt)){n=1;break}n+=sg(e,r)}DR.set(t,n)}return n}function XP(e,t,n,r,i,o,s,a,l){let u=0;for(let p=r;p<i;p++)u+=sg(e,t[p]);let c=Math.ceil(u*1.5/8),f=[],h=[];function d(p,m,v,b,y){for(let x=v;x<b;){let k=x,w=m[x],S=sg(e,p[x]);for(x++;x<b;x++){let O=sg(e,p[x]);if(S+O>=c)break;S+=O}if(x==k+1){if(S>c){let O=p[k];d(O.children,O.positions,0,O.children.length,m[k]+y);continue}f.push(p[k])}else{let O=m[x-1]+p[x-1].length-w;f.push(XP(e,p,m,k,x,w,O,null,l))}h.push(w+y-o)}}return d(t,n,r,i,0),(a||l)(f,h,s)}class za{constructor(t,n,r,i,o=!1,s=!1){this.from=t,this.to=n,this.tree=r,this.offset=i,this.open=(o?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new za(0,t.length,t,0,!1,r)];for(let o of n)o.to>t.length&&i.push(o);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],o=1,s=t.length?t[0]:null;for(let a=0,l=0,u=0;;a++){let c=a<n.length?n[a]:null,f=c?c.fromA:1e9;if(f-l>=r)for(;s&&s.from<f;){let h=s;if(l>=h.from||f<=h.to||u){let d=Math.max(h.from,l)-u,p=Math.min(h.to,f)-u;h=d>=p?null:new za(d,p,h.tree,h.offset+u,a>0,!!c)}if(h&&i.push(h),s.to>f)break;s=o<t.length?t[o++]:null}if(!c)break;l=c.toA,u=c.toA-c.toB}return i}}class N9{startParse(t,n,r){return typeof t=="string"&&(t=new dNe(t)),r=r?r.length?r.map(i=>new x1(i.from,i.to)):[new x1(0,0)]:[new x1(0,t.length)],this.createParse(t,n||[],r)}parse(t,n,r){let i=this.startParse(t,n,r);for(;;){let o=i.advance();if(o)return o}}}class dNe{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,n){return this.string.slice(t,n)}}new Te({perNode:!0});let pNe=0,lo=class OO{constructor(t,n,r,i){this.name=t,this.set=n,this.base=r,this.modified=i,this.id=pNe++}toString(){let{name:t}=this;for(let n of this.modified)n.name&&(t=`${n.name}(${t})`);return t}static define(t,n){let r=typeof t=="string"?t:"?";if(t instanceof OO&&(n=t),n?.base)throw new Error("Can not derive from a modified tag");let i=new OO(r,[],null,[]);if(i.set.push(i),n)for(let o of n.set)i.set.push(o);return i}static defineModifier(t){let n=new dv(t);return r=>r.modified.indexOf(n)>-1?r:dv.get(r.base||r,r.modified.concat(n).sort((i,o)=>i.id-o.id))}},mNe=0;class dv{constructor(t){this.name=t,this.instances=[],this.id=mNe++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(a=>a.base==t&&gNe(n,a.modified));if(r)return r;let i=[],o=new lo(t.name,i,t,n);for(let a of n)a.instances.push(o);let s=yNe(n);for(let a of t.set)if(!a.modified.length)for(let l of s)i.push(dv.get(a,l));return o}}function gNe(e,t){return e.length==t.length&&e.every((n,r)=>n==t[r])}function yNe(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((n,r)=>r.length-n.length)}function R9(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let o=[],s=2,a=i;for(let f=0;;){if(a=="..."&&f>0&&f+3==i.length){s=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!h)throw new RangeError("Invalid path: "+i);if(o.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),f+=h[0].length,f==i.length)break;let d=i[f++];if(f==i.length&&d=="!"){s=0;break}if(d!="/")throw new RangeError("Invalid path: "+i);a=i.slice(f)}let l=o.length-1,u=o[l];if(!u)throw new RangeError("Invalid path: "+i);let c=new Ld(r,s,l>0?o.slice(0,l):null);t[u]=c.sort(t[u])}}return D9.add(t)}const D9=new Te({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth>=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let o=new Ld(i.tags,i.mode,i.context);n?n.next=o:r=o,n=o}return r}});class Ld{constructor(t,n,r,i){this.tags=t,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth<this.depth?(this.next=t,this):(t.next=this.sort(t.next),t)}get depth(){return this.context?this.context.length:0}}Ld.empty=new Ld([],2,null);function L9(e,t){let n=Object.create(null);for(let o of e)if(!Array.isArray(o.tag))n[o.tag.id]=o.class;else for(let s of o.tag)n[s.id]=o.class;let{scope:r,all:i=null}=t||{};return{style:o=>{let s=i;for(let a of o)for(let l of a.set){let u=n[l.id];if(u){s=s?s+" "+u:u;break}}return s},scope:r}}function vNe(e,t){let n=null;for(let r of e){let i=r.style(t);i&&(n=n?n+" "+i:i)}return n}function bNe(e,t,n,r=0,i=e.length){let o=new xNe(r,Array.isArray(t)?t:[t],n);o.highlightRange(e.cursor(),r,i,"",o.highlighters),o.flush(i)}class xNe{constructor(t,n,r){this.at=t,this.highlighters=n,this.span=r,this.class=""}startSpan(t,n){n!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=n)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,n,r,i,o){let{type:s,from:a,to:l}=t;if(a>=r||l<=n)return;s.isTop&&(o=this.highlighters.filter(d=>!d.scope||d.scope(s)));let u=i,c=wNe(t)||Ld.empty,f=vNe(o,c.tags);if(f&&(u&&(u+=" "),u+=f,c.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(n,a),u),c.opaque)return;let h=t.tree&&t.tree.prop(Te.mounted);if(h&&h.overlay){let d=t.node.enter(h.overlay[0].from+a,1),p=this.highlighters.filter(v=>!v.scope||v.scope(h.tree.type)),m=t.firstChild();for(let v=0,b=a;;v++){let y=v<h.overlay.length?h.overlay[v]:null,x=y?y.from+a:l,k=Math.max(n,b),w=Math.min(r,x);if(k<w&&m)for(;t.from<w&&(this.highlightRange(t,k,w,i,o),this.startSpan(Math.min(w,t.to),u),!(t.to>=x||!t.nextSibling())););if(!y||x>r)break;b=y.to+a,b>n&&(this.highlightRange(d.cursor(),Math.max(n,y.from+a),Math.min(r,b),"",p),this.startSpan(Math.min(r,b),u))}m&&t.parent()}else if(t.firstChild()){h&&(i="");do if(!(t.to<=n)){if(t.from>=r)break;this.highlightRange(t,n,r,i,o),this.startSpan(Math.min(r,t.to),u)}while(t.nextSibling());t.parent()}}}function wNe(e){let t=e.type.prop(D9);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}const re=lo.define,km=re(),Xo=re(),LR=re(Xo),$R=re(Xo),Yo=re(),Om=re(Yo),w1=re(Yo),Ai=re(),oa=re(Ai),Oi=re(),Ci=re(),CO=re(),Pf=re(CO),Cm=re(),W={comment:km,lineComment:re(km),blockComment:re(km),docComment:re(km),name:Xo,variableName:re(Xo),typeName:LR,tagName:re(LR),propertyName:$R,attributeName:re($R),className:re(Xo),labelName:re(Xo),namespace:re(Xo),macroName:re(Xo),literal:Yo,string:Om,docString:re(Om),character:re(Om),attributeValue:re(Om),number:w1,integer:re(w1),float:re(w1),bool:re(Yo),regexp:re(Yo),escape:re(Yo),color:re(Yo),url:re(Yo),keyword:Oi,self:re(Oi),null:re(Oi),atom:re(Oi),unit:re(Oi),modifier:re(Oi),operatorKeyword:re(Oi),controlKeyword:re(Oi),definitionKeyword:re(Oi),moduleKeyword:re(Oi),operator:Ci,derefOperator:re(Ci),arithmeticOperator:re(Ci),logicOperator:re(Ci),bitwiseOperator:re(Ci),compareOperator:re(Ci),updateOperator:re(Ci),definitionOperator:re(Ci),typeOperator:re(Ci),controlOperator:re(Ci),punctuation:CO,separator:re(CO),bracket:Pf,angleBracket:re(Pf),squareBracket:re(Pf),paren:re(Pf),brace:re(Pf),content:Ai,heading:oa,heading1:re(oa),heading2:re(oa),heading3:re(oa),heading4:re(oa),heading5:re(oa),heading6:re(oa),contentSeparator:re(Ai),list:re(Ai),quote:re(Ai),emphasis:re(Ai),strong:re(Ai),link:re(Ai),monospace:re(Ai),strikethrough:re(Ai),inserted:re(),deleted:re(),changed:re(),invalid:re(),meta:Cm,documentMeta:re(Cm),annotation:re(Cm),processingInstruction:re(Cm),definition:lo.defineModifier("definition"),constant:lo.defineModifier("constant"),function:lo.defineModifier("function"),standard:lo.defineModifier("standard"),local:lo.defineModifier("local"),special:lo.defineModifier("special")};for(let e in W){let t=W[e];t instanceof lo&&(t.name=e)}L9([{tag:W.link,class:"tok-link"},{tag:W.heading,class:"tok-heading"},{tag:W.emphasis,class:"tok-emphasis"},{tag:W.strong,class:"tok-strong"},{tag:W.keyword,class:"tok-keyword"},{tag:W.atom,class:"tok-atom"},{tag:W.bool,class:"tok-bool"},{tag:W.url,class:"tok-url"},{tag:W.labelName,class:"tok-labelName"},{tag:W.inserted,class:"tok-inserted"},{tag:W.deleted,class:"tok-deleted"},{tag:W.literal,class:"tok-literal"},{tag:W.string,class:"tok-string"},{tag:W.number,class:"tok-number"},{tag:[W.regexp,W.escape,W.special(W.string)],class:"tok-string2"},{tag:W.variableName,class:"tok-variableName"},{tag:W.local(W.variableName),class:"tok-variableName tok-local"},{tag:W.definition(W.variableName),class:"tok-variableName tok-definition"},{tag:W.special(W.variableName),class:"tok-variableName2"},{tag:W.definition(W.propertyName),class:"tok-propertyName tok-definition"},{tag:W.typeName,class:"tok-typeName"},{tag:W.namespace,class:"tok-namespace"},{tag:W.className,class:"tok-className"},{tag:W.macroName,class:"tok-macroName"},{tag:W.propertyName,class:"tok-propertyName"},{tag:W.operator,class:"tok-operator"},{tag:W.comment,class:"tok-comment"},{tag:W.meta,class:"tok-meta"},{tag:W.invalid,class:"tok-invalid"},{tag:W.punctuation,class:"tok-punctuation"}]);var S1;const uu=new Te;function SNe(e){return se.define({combine:e?t=>t.concat(e):void 0})}const kNe=new Te;class hi{constructor(t,n,r=[],i=""){this.data=t,this.name=i,Ne.prototype.hasOwnProperty("tree")||Object.defineProperty(Ne.prototype,"tree",{get(){return xn(this)}}),this.parser=n,this.extension=[Ds.of(this),Ne.languageData.of((o,s,a)=>{let l=BR(o,s,a),u=l.type.prop(uu);if(!u)return[];let c=o.facet(u),f=l.type.prop(kNe);if(f){let h=l.resolve(s-l.from,a);for(let d of f)if(d.test(h,o)){let p=o.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(r)}isActiveAt(t,n,r=-1){return BR(t,n,r).type.prop(uu)==this.data}findRegions(t){let n=t.facet(Ds);if(n?.data==this.data)return[{from:0,to:t.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(o,s)=>{if(o.prop(uu)==this.data){r.push({from:s,to:s+o.length});return}let a=o.prop(Te.mounted);if(a){if(a.tree.prop(uu)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+s,to:l.to+s});else r.push({from:s,to:s+o.length});return}else if(a.overlay){let l=r.length;if(i(a.tree,a.overlay[0].from+s),r.length>l)return}}for(let l=0;l<o.children.length;l++){let u=o.children[l];u instanceof jt&&i(u,o.positions[l]+s)}};return i(xn(t),0),r}get allowsNesting(){return!0}}hi.setState=ke.define();function BR(e,t,n){let r=e.facet(Ds),i=xn(e).topNode;if(!r||r.allowsNesting)for(let o=i;o;o=o.enter(t,n,At.ExcludeBuffers|At.EnterBracketed))o.type.isTop&&(i=o);return i}class pv extends hi{constructor(t,n,r){super(t,n,[],r),this.parser=n}static define(t){let n=SNe(t.languageData);return new pv(n,t.parser.configure({props:[uu.add(r=>r.isTop?n:void 0)]}),t.name)}configure(t,n){return new pv(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function xn(e){let t=e.field(hi.state,!1);return t?t.tree:jt.empty}class ONe{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,n){let r=this.cursorPos-this.string.length;return t<r||n>=this.cursorPos?this.doc.sliceString(t,n):this.string.slice(t-r,n-r)}}let Ef=null;class mv{constructor(t,n,r=[],i,o,s,a,l){this.parser=t,this.state=n,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=s,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new mv(t,n,[],jt.empty,0,r,[],null)}startParse(){return this.parser.startParse(new ONe(this.state.doc),this.fragments)}work(t,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=jt.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof t=="number"){let i=Date.now()+t;t=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(za.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(t())return!1}})}takeTree(){let t,n;this.parse&&(t=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=t,this.tree=n,this.fragments=this.withoutTempSkipped(za.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let n=Ef;Ef=this;try{return t()}finally{Ef=n}}withoutTempSkipped(t){for(let n;n=this.tempSkipped.pop();)t=FR(t,n.from,n.to);return t}changes(t,n){let{fragments:r,tree:i,treeLen:o,viewport:s,skipped:a}=this;if(this.takeTree(),!t.empty){let l=[];if(t.iterChangedRanges((u,c,f,h)=>l.push({fromA:u,toA:c,fromB:f,toB:h})),r=za.applyChanges(r,l),i=jt.empty,o=0,s={from:t.mapPos(s.from,-1),to:t.mapPos(s.to,1)},this.skipped.length){a=[];for(let u of this.skipped){let c=t.mapPos(u.from,1),f=t.mapPos(u.to,-1);c<f&&a.push({from:c,to:f})}}}return new mv(this.parser,n,r,i,o,s,a,this.scheduleOn)}updateViewport(t){if(this.viewport.from==t.from&&this.viewport.to==t.to)return!1;this.viewport=t;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:o}=this.skipped[r];i<t.to&&o>t.from&&(this.fragments=FR(this.fragments,i,o),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,n){this.skipped.push({from:t,to:n})}static getSkippingParser(t){return new class extends N9{createParse(n,r,i){let o=i[0].from,s=i[i.length-1].to;return{parsedPos:o,advance(){let l=Ef;if(l){for(let u of i)l.tempSkipped.push(u);t&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,t]):t)}return this.parsedPos=s,new jt(nr.none,[],[],s-o)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let n=this.fragments;return this.treeLen>=t&&n.length&&n[0].from==0&&n[0].to>=t}static get(){return Ef}}function FR(e,t,n){return za.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class xc{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new xc(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=mv.create(t.facet(Ds).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new xc(r)}}hi.state=kn.define({create:xc.init,update(e,t){for(let n of t.effects)if(n.is(hi.setState))return n.value;return t.startState.facet(Ds)!=t.state.facet(Ds)?xc.init(t.state):e.apply(t)}});let $9=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&($9=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const k1=typeof navigator<"u"&&(!((S1=navigator.scheduling)===null||S1===void 0)&&S1.isInputPending)?()=>navigator.scheduling.isInputPending():null,CNe=Et.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let n=this.view.state.field(hi.state).context;(n.updateViewport(t.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:t}=this.view,n=t.field(hi.state);(n.tree!=n.context.tree||!n.context.isDone(t.doc.length))&&(this.working=$9(this.work))}work(t){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,o=r.field(hi.state);if(o.tree==o.context.tree&&o.context.isDone(i+1e5))return;let s=Date.now()+Math.min(this.chunkBudget,100,t&&!k1?Math.max(25,t.timeRemaining()-5):1e9),a=o.context.treeLen<i&&r.doc.length>i+1e3,l=o.context.work(()=>k1&&k1()||Date.now()>s,i+(a?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:hi.setState.of(new xc(o.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Gn(this.view.state,n)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Ds=se.define({combine(e){return e.length?e[0]:null},enables:e=>[hi.state,CNe,ie.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class ANe{constructor(t,n=[]){this.language=t,this.support=n,this.extension=[t,n]}}const PNe=se.define(),db=se.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(n=>n!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function gv(e){let t=e.facet(db);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function $d(e,t){let n="",r=e.tabSize,i=e.facet(db)[0];if(i==" "){for(;t>=r;)n+=" ",t-=r;i=" "}for(let o=0;o<t;o++)n+=i;return n}function YP(e,t){e instanceof Ne&&(e=new pb(e));for(let r of e.state.facet(PNe)){let i=r(e,t);if(i!==void 0)return i}let n=xn(e.state);return n.length>=t?ENe(e,n,t):null}class pb{constructor(t,n={}){this.state=t,this.options=n,this.unit=gv(t)}lineAt(t,n=1){let r=this.state.doc.lineAt(t),{simulateBreak:i,simulateDoubleBreak:o}=this.options;return i!=null&&i>=r.from&&i<=r.to?o&&i==t?{text:"",from:t}:(n<0?i<t:i<=t)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(t,n=1){if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(t,n);return r.slice(t-i,Math.min(r.length,t+100-i))}column(t,n=1){let{text:r,from:i}=this.lineAt(t,n),o=this.countColumn(r,t-i),s=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return s>-1&&(o+=s-this.countColumn(r,r.search(/\S|$/))),o}countColumn(t,n=t.length){return qc(t,this.state.tabSize,n)}lineIndent(t,n=1){let{text:r,from:i}=this.lineAt(t,n),o=this.options.overrideIndentation;if(o){let s=o(i);if(s>-1)return s}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const B9=new Te;function ENe(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let o=[];for(let s=i;s&&!(s.from<r.node.from||s.to>r.node.to||s.from==r.node.from&&s.type==r.node.type);s=s.parent)o.push(s);for(let s=o.length-1;s>=0;s--)r={node:o[s],next:r}}return F9(r,e,n)}function F9(e,t,n){for(let r=e;r;r=r.next){let i=_Ne(r.node);if(i)return i(ZP.create(t,n,r))}return 0}function TNe(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function _Ne(e){let t=e.type.prop(B9);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(Te.closedBy))){let i=e.lastChild,o=i&&r.indexOf(i.name)>-1;return s=>z9(s,!0,1,void 0,o&&!TNe(s)?i.from:void 0)}return e.parent==null?jNe:null}function jNe(){return 0}class ZP extends pb{constructor(t,n,r){super(t.state,t.options),this.base=t,this.pos=n,this.context=r}get node(){return this.context.node}static create(t,n,r){return new ZP(t,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let n=this.state.doc.lineAt(t.from);for(;;){let r=t.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(MNe(r,t))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return F9(this.context.next,this.base,this.pos)}}function MNe(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function INe(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,o=e.state.doc.lineAt(n.from),s=i==null||i<=o.from?o.to:Math.min(o.to,i);for(let a=n.to;;){let l=t.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped){if(l.from>=s)return null;let u=/^ */.exec(o.text.slice(n.to-o.from))[0].length;return{from:n.from,to:n.to+u}}a=l.to}}function zR({closing:e,align:t=!0,units:n=1}){return r=>z9(r,t,n,e)}function z9(e,t,n,r,i){let o=e.textAfter,s=o.match(/^\s*/)[0].length,a=r&&o.slice(s,s+r.length)==r||i==e.pos+s,l=t?INe(e):null;return l?a?e.column(l.from):e.column(l.to):e.baseIndent+(a?0:e.unit*n)}const NNe=200;function RNe(){return Ne.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:r}=e.newSelection.main,i=n.lineAt(r);if(r>i.from+NNe)return e;let o=n.sliceString(i.from,r);if(!t.some(u=>u.test(o)))return e;let{state:s}=e,a=-1,l=[];for(let{head:u}of s.selection.ranges){let c=s.doc.lineAt(u);if(c.from==a)continue;a=c.from;let f=YP(s,c.from);if(f==null)continue;let h=/^\s*/.exec(c.text)[0],d=$d(s,f);h!=d&&l.push({from:c.from,to:c.from+h.length,insert:d})}return l.length?[e,{changes:l,sequential:!0}]:e})}const DNe=se.define(),W9=new Te;function LNe(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}function $Ne(e,t,n){let r=xn(e);if(r.length<n)return null;let i=r.resolveStack(n,1),o=null;for(let s=i;s;s=s.next){let a=s.node;if(a.to<=n||a.from>n)continue;if(o&&a.from<t)break;let l=a.type.prop(W9);if(l&&(a.to<r.length-50||r.length==e.doc.length||!BNe(a))){let u=l(a,e);u&&u.from<=n&&u.from>=t&&u.to>n&&(o=u)}}return o}function BNe(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function yv(e,t,n){for(let r of e.facet(DNe)){let i=r(e,t,n);if(i)return i}return $Ne(e,t,n)}function U9(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}const mb=ke.define({map:U9}),hp=ke.define({map:U9});function H9(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(r=>r.from<=n&&r.to>=n)||t.push(e.lineBlockAt(n));return t}const ol=kn.define({create(){return de.none},update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((n,r)=>e=WR(e,n,r)),e=e.map(t.changes);for(let n of t.effects)if(n.is(mb)&&!FNe(e,n.value.from,n.value.to)){let{preparePlaceholder:r}=t.state.facet(K9),i=r?de.replace({widget:new KNe(r(t.state,n.value))}):UR;e=e.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(hp)&&(e=e.update({filter:(r,i)=>n.value.from!=r||n.value.to!=i,filterFrom:n.value.from,filterTo:n.value.to}));return t.selection&&(e=WR(e,t.selection.main.head)),e},provide:e=>ie.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n<e.length;){let r=e[n++],i=e[n++];if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");t.push(UR.range(r,i))}return de.set(t,!0)}});function WR(e,t,n=t){let r=!1;return e.between(t,n,(i,o)=>{i<n&&o>t&&(r=!0)}),r?e.update({filterFrom:t,filterTo:n,filter:(i,o)=>i>=n||o<=t}):e}function vv(e,t,n){var r;let i=null;return(r=e.field(ol,!1))===null||r===void 0||r.between(t,n,(o,s)=>{(!i||i.from>o)&&(i={from:o,to:s})}),i}function FNe(e,t,n){let r=!1;return e.between(t,t,(i,o)=>{i==t&&o==n&&(r=!0)}),r}function V9(e,t){return e.field(ol,!1)?t:t.concat(ke.appendConfig.of(G9()))}const zNe=e=>{for(let t of H9(e)){let n=yv(e.state,t.from,t.to);if(n)return e.dispatch({effects:V9(e.state,[mb.of(n),q9(e,n)])}),!0}return!1},WNe=e=>{if(!e.state.field(ol,!1))return!1;let t=[];for(let n of H9(e)){let r=vv(e.state,n.from,n.to);r&&t.push(hp.of(r),q9(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function q9(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return ie.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${e.state.phrase("to")} ${i}.`)}const UNe=e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let i=e.lineBlockAt(r),o=yv(t,i.from,i.to);o&&n.push(mb.of(o)),r=(o?e.lineBlockAt(o.to):i).to+1}return n.length&&e.dispatch({effects:V9(e.state,n)}),!!n.length},HNe=e=>{let t=e.state.field(ol,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(r,i)=>{n.push(hp.of({from:r,to:i}))}),e.dispatch({effects:n}),!0},VNe=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:zNe},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:WNe},{key:"Ctrl-Alt-[",run:UNe},{key:"Ctrl-Alt-]",run:HNe}],qNe={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},K9=se.define({combine(e){return Ji(e,qNe)}});function G9(e){return[ol,XNe]}function Q9(e,t){let{state:n}=e,r=n.facet(K9),i=s=>{let a=e.lineBlockAt(e.posAtDOM(s.target)),l=vv(e.state,a.from,a.to);l&&e.dispatch({effects:hp.of(l)}),s.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,i,t);let o=document.createElement("span");return o.textContent=r.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=i,o}const UR=de.replace({widget:new class extends eo{toDOM(e){return Q9(e,null)}}});class KNe extends eo{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return Q9(t,this.value)}}const GNe={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class O1 extends Ro{constructor(t,n){super(),this.config=t,this.open=n}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=t.state.phrase(this.open?"Fold line":"Unfold line"),n}}function QNe(e={}){let t={...GNe,...e},n=new O1(t,!0),r=new O1(t,!1),i=Et.fromClass(class{constructor(s){this.from=s.viewport.from,this.markers=this.buildMarkers(s)}update(s){(s.docChanged||s.viewportChanged||s.startState.facet(Ds)!=s.state.facet(Ds)||s.startState.field(ol,!1)!=s.state.field(ol,!1)||xn(s.startState)!=xn(s.state)||t.foldingChanged(s))&&(this.markers=this.buildMarkers(s.view))}buildMarkers(s){let a=new Io;for(let l of s.viewportLineBlocks){let u=vv(s.state,l.from,l.to)?r:yv(s.state,l.from,l.to)?n:null;u&&a.add(l.from,l.from,u)}return a.finish()}}),{domEventHandlers:o}=t;return[i,XIe({class:"cm-foldGutter",markers(s){var a;return((a=s.plugin(i))===null||a===void 0?void 0:a.markers)||_e.empty},initialSpacer(){return new O1(t,!1)},domEventHandlers:{...o,click:(s,a,l)=>{if(o.click&&o.click(s,a,l))return!0;let u=vv(s.state,a.from,a.to);if(u)return s.dispatch({effects:hp.of(u)}),!0;let c=yv(s.state,a.from,a.to);return c?(s.dispatch({effects:mb.of(c)}),!0):!1}}}),G9()]}const XNe=ie.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class dp{constructor(t,n){this.specs=t;let r;function i(a){let l=Ms.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const o=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,s=n.scope;this.scope=s instanceof hi?a=>a.prop(uu)==s.data:s?a=>a==s:void 0,this.style=L9(t.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:o}).style,this.module=r?new Ms(r):null,this.themeType=n.themeType}static define(t,n){return new dp(t,n||{})}}const AO=se.define(),X9=se.define({combine(e){return e.length?[e[0]]:null}});function C1(e){let t=e.facet(AO);return t.length?t:e.facet(X9)}function Y9(e,t){let n=[ZNe],r;return e instanceof dp&&(e.module&&n.push(ie.styleModule.of(e.module)),r=e.themeType),t?.fallback?n.push(X9.of(e)):r?n.push(AO.computeN([ie.darkTheme],i=>i.facet(ie.darkTheme)==(r=="dark")?[e]:[])):n.push(AO.of(e)),n}class YNe{constructor(t){this.markCache=Object.create(null),this.tree=xn(t.state),this.decorations=this.buildDeco(t,C1(t.state)),this.decoratedTo=t.viewport.to}update(t){let n=xn(t.state),r=C1(t.state),i=r!=C1(t.startState),{viewport:o}=t.view,s=t.changes.mapPos(this.decoratedTo,1);n.length<o.to&&!i&&n.type==this.tree.type&&s>=o.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=s):(n!=this.tree||t.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(t.view,r),this.decoratedTo=o.to)}buildDeco(t,n){if(!n||!this.tree.length)return de.none;let r=new Io;for(let{from:i,to:o}of t.visibleRanges)bNe(this.tree,n,(s,a,l)=>{r.add(s,a,this.markCache[l]||(this.markCache[l]=de.mark({class:l})))},i,o);return r.finish()}}const ZNe=bl.high(Et.fromClass(YNe,{decorations:e=>e.decorations})),JNe=dp.define([{tag:W.meta,color:"#404740"},{tag:W.link,textDecoration:"underline"},{tag:W.heading,textDecoration:"underline",fontWeight:"bold"},{tag:W.emphasis,fontStyle:"italic"},{tag:W.strong,fontWeight:"bold"},{tag:W.strikethrough,textDecoration:"line-through"},{tag:W.keyword,color:"#708"},{tag:[W.atom,W.bool,W.url,W.contentSeparator,W.labelName],color:"#219"},{tag:[W.literal,W.inserted],color:"#164"},{tag:[W.string,W.deleted],color:"#a11"},{tag:[W.regexp,W.escape,W.special(W.string)],color:"#e40"},{tag:W.definition(W.variableName),color:"#00f"},{tag:W.local(W.variableName),color:"#30a"},{tag:[W.typeName,W.namespace],color:"#085"},{tag:W.className,color:"#167"},{tag:[W.special(W.variableName),W.macroName],color:"#256"},{tag:W.definition(W.propertyName),color:"#00c"},{tag:W.comment,color:"#940"},{tag:W.invalid,color:"#f00"}]),eRe=ie.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Z9=1e4,J9="()[]{}",eW=se.define({combine(e){return Ji(e,{afterCursor:!0,brackets:J9,maxScanDistance:Z9,renderMatch:rRe})}}),tRe=de.mark({class:"cm-matchingBracket"}),nRe=de.mark({class:"cm-nonmatchingBracket"});function rRe(e){let t=[],n=e.matched?tRe:nRe;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function HR(e){let t=[],n=e.facet(eW);for(let r of e.selection.ranges){if(!r.empty)continue;let i=$i(e,r.head,-1,n)||r.head>0&&$i(e,r.head-1,1,n)||n.afterCursor&&($i(e,r.head,1,n)||r.head<e.doc.length&&$i(e,r.head+1,-1,n));i&&(t=t.concat(n.renderMatch(i,e)))}return de.set(t,!0)}const iRe=Et.fromClass(class{constructor(e){this.paused=!1,this.decorations=HR(e.state)}update(e){(e.docChanged||e.selectionSet||this.paused)&&(e.view.composing?(this.decorations=this.decorations.map(e.changes),this.paused=!0):(this.decorations=HR(e.state),this.paused=!1))}},{decorations:e=>e.decorations}),oRe=[iRe,eRe];function sRe(e={}){return[eW.of(e),oRe]}const aRe=new Te;function PO(e,t,n){let r=e.prop(t<0?Te.openedBy:Te.closedBy);if(r)return r;if(e.name.length==1){let i=n.indexOf(e.name);if(i>-1&&i%2==(t<0?1:0))return[n[i+t]]}return null}function EO(e){let t=e.type.prop(aRe);return t?t(e.node):e}function $i(e,t,n,r={}){let i=r.maxScanDistance||Z9,o=r.brackets||J9,s=xn(e),a=s.resolveInner(t,n);for(let l=a;l;l=l.parent){let u=PO(l.type,n,o);if(u&&l.from<l.to){let c=EO(l);if(c&&(n>0?t>=c.from&&t<c.to:t>c.from&&t<=c.to))return lRe(e,t,n,l,c,u,o)}}return uRe(e,t,n,s,a.type,i,o)}function lRe(e,t,n,r,i,o,s){let a=r.parent,l={from:i.from,to:i.to},u=0,c=a?.cursor();if(c&&(n<0?c.childBefore(r.from):c.childAfter(r.to)))do if(n<0?c.to<=r.from:c.from>=r.to){if(u==0&&o.indexOf(c.type.name)>-1&&c.from<c.to){let f=EO(c);return{start:l,end:f?{from:f.from,to:f.to}:void 0,matched:!0}}else if(PO(c.type,n,s))u++;else if(PO(c.type,-n,s)){if(u==0){let f=EO(c);return{start:l,end:f&&f.from<f.to?{from:f.from,to:f.to}:void 0,matched:!1}}u--}}while(n<0?c.prevSibling():c.nextSibling());return{start:l,matched:!1}}function uRe(e,t,n,r,i,o,s){if(n<0?!t:t==e.doc.length)return null;let a=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),l=s.indexOf(a);if(l<0||l%2==0!=n>0)return null;let u={from:n<0?t-1:t,to:n>0?t+1:t},c=e.doc.iterRange(t,n>0?e.doc.length:0),f=0;for(let h=0;!c.next().done&&h<=o;){let d=c.value;n<0&&(h+=d.length);let p=t+h*n;for(let m=n>0?0:d.length-1,v=n>0?d.length:-1;m!=v;m+=n){let b=s.indexOf(d[m]);if(!(b<0||r.resolveInner(p+m,1).type!=i))if(b%2==0==n>0)f++;else{if(f==1)return{start:u,end:{from:p+m,to:p+m+1},matched:b>>1==l>>1};f--}}n>0&&(h+=d.length)}return c.done?{start:u,matched:!1}:null}const cRe=Object.create(null),VR=[nr.none],qR=[],KR=Object.create(null),fRe=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])fRe[e]=hRe(cRe,t);function A1(e,t){qR.indexOf(e)>-1||(qR.push(e),console.warn(t))}function hRe(e,t){let n=[];for(let a of t.split(" ")){let l=[];for(let u of a.split(".")){let c=e[u]||W[u];c?typeof c=="function"?l.length?l=l.map(c):A1(u,`Modifier ${u} used at start of tag`):l.length?A1(u,`Tag ${u} used as modifier`):l=Array.isArray(c)?c:[c]:A1(u,`Unknown highlighting tag ${u}`)}for(let u of l)n.push(u)}if(!n.length)return 0;let r=t.replace(/ /g,"_"),i=r+" "+n.map(a=>a.id),o=KR[i];if(o)return o.id;let s=KR[i]=nr.define({id:VR.length,name:r,props:[R9({[r]:n})]});return VR.push(s),s.id}Je.RTL,Je.LTR;const dRe=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=eE(e.state,n.from);return r.line?pRe(e):r.block?gRe(e):!1};function JP(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}const pRe=JP(bRe,0),mRe=JP(tW,0),gRe=JP((e,t)=>tW(e,t,vRe(t)),0);function eE(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const Tf=50;function yRe(e,{open:t,close:n},r,i){let o=e.sliceDoc(r-Tf,r),s=e.sliceDoc(i,i+Tf),a=/\s*$/.exec(o)[0].length,l=/^\s*/.exec(s)[0].length,u=o.length-a;if(o.slice(u-t.length,u)==t&&s.slice(l,l+n.length)==n)return{open:{pos:r-a,margin:a&&1},close:{pos:i+l,margin:l&&1}};let c,f;i-r<=2*Tf?c=f=e.sliceDoc(r,i):(c=e.sliceDoc(r,r+Tf),f=e.sliceDoc(i-Tf,i));let h=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-n.length;return c.slice(h,h+t.length)==t&&f.slice(p,p+n.length)==n?{open:{pos:r+h+t.length,margin:/\s/.test(c.charAt(h+t.length))?1:0},close:{pos:i-d-n.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function vRe(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let o=t.length-1;o>=0&&t[o].to>r.from?t[o].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function tW(e,t,n=t.selection.ranges){let r=n.map(o=>eE(t,o.from).block);if(!r.every(o=>o))return null;let i=n.map((o,s)=>yRe(t,r[s],o.from,o.to));if(e!=2&&!i.every(o=>o))return{changes:t.changes(n.map((o,s)=>i[s]?[]:[{from:o.from,insert:r[s].open+" "},{from:o.to,insert:" "+r[s].close}]))};if(e!=1&&i.some(o=>o)){let o=[];for(let s=0,a;s<i.length;s++)if(a=i[s]){let l=r[s],{open:u,close:c}=a;o.push({from:u.pos-l.open.length,to:u.pos+u.margin},{from:c.pos-c.margin,to:c.pos+l.close.length})}return{changes:o}}return null}function bRe(e,t,n=t.selection.ranges){let r=[],i=-1;e:for(let{from:o,to:s}of n){let a=r.length,l=1e9,u;for(let c=o;c<=s;){let f=t.doc.lineAt(c);if(u==null&&(u=eE(t,f.from).line,!u))continue e;if(f.from>i&&(o==s||s>f.from)){i=f.from;let h=/^\s*/.exec(f.text)[0].length,d=h==f.length,p=f.text.slice(h,h+u.length)==u?h:-1;h<f.text.length&&h<l&&(l=h),r.push({line:f,comment:p,token:u,indent:h,empty:d,single:!1})}c=f.to+1}if(l<1e9)for(let c=a;c<r.length;c++)r[c].indent<r[c].line.text.length&&(r[c].indent=l);r.length==a+1&&(r[a].single=!0)}if(e!=2&&r.some(o=>o.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:a,token:l,indent:u,empty:c,single:f}of r)(f||!c)&&o.push({from:a.from+u,insert:l+" "});let s=t.changes(o);return{changes:s,selection:t.selection.map(s,1)}}else if(e!=1&&r.some(o=>o.comment>=0)){let o=[];for(let{line:s,comment:a,token:l}of r)if(a>=0){let u=s.from+a,c=u+l.length;s.text[c-s.from]==" "&&c++,o.push({from:u,to:c})}return{changes:o}}return null}const TO=Zi.define(),xRe=Zi.define(),wRe=se.define(),nW=se.define({combine(e){return Ji(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(r,i)=>t(r,i)||n(r,i)})}}),rW=kn.define({create(){return Bi.empty},update(e,t){let n=t.state.facet(nW),r=t.annotation(TO);if(r){let l=Qn.fromTransaction(t,r.selection),u=r.side,c=u==0?e.undone:e.done;return l?c=bv(c,c.length,n.minDepth,l):c=sW(c,t.startState.selection),new Bi(u==0?r.rest:c,u==0?c:r.rest)}let i=t.annotation(xRe);if((i=="full"||i=="before")&&(e=e.isolate()),t.annotation(Kt.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let o=Qn.fromTransaction(t),s=t.annotation(Kt.time),a=t.annotation(Kt.userEvent);return o?e=e.addChanges(o,s,a,n,t):t.selection&&(e=e.addSelection(t.startState.selection,s,a,n.newGroupDelay)),(i=="full"||i=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new Bi(e.done.map(Qn.fromJSON),e.undone.map(Qn.fromJSON))}});function SRe(e={}){return[rW,nW.of(e),ie.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?iW:t.inputType=="historyRedo"?_O:null;return r?(t.preventDefault(),r(n)):!1}})]}function gb(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(rW,!1);if(!i)return!1;let o=i.pop(e,n,t);return o?(r(o),!0):!1}}const iW=gb(0,!1),_O=gb(1,!1),kRe=gb(0,!0),ORe=gb(1,!0);class Qn{constructor(t,n,r,i,o){this.changes=t,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}setSelAfter(t){return new Qn(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,r;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(t){return new Qn(t.changes&&zt.fromJSON(t.changes),[],t.mapped&&Ki.fromJSON(t.mapped),t.startSelection&&V.fromJSON(t.startSelection),t.selectionsAfter.map(V.fromJSON))}static fromTransaction(t,n){let r=Wr;for(let i of t.startState.facet(wRe)){let o=i(t);o.length&&(r=r.concat(o))}return!r.length&&t.changes.empty?null:new Qn(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,Wr)}static selection(t){return new Qn(void 0,Wr,void 0,void 0,t)}}function bv(e,t,n,r){let i=t+1>n+20?t-n-1:0,o=e.slice(i,t);return o.push(r),o}function CRe(e,t){let n=[],r=!1;return e.iterChangedRanges((i,o)=>n.push(i,o)),t.iterChangedRanges((i,o,s,a)=>{for(let l=0;l<n.length;){let u=n[l++],c=n[l++];a>=u&&s<=c&&(r=!0)}}),r}function ARe(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function oW(e,t){return e.length?t.length?e.concat(t):e:t}const Wr=[],PRe=200;function sW(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-PRe));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),bv(e,e.length-1,1e9,n.setSelAfter(r)))}else return[Qn.selection([t])]}function ERe(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function P1(e,t){if(!e.length)return e;let n=e.length,r=Wr;for(;n;){let i=TRe(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let o=e.slice(0,n);return o[n-1]=i,o}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[Qn.selection(r)]:Wr}function TRe(e,t,n){let r=oW(e.selectionsAfter.length?e.selectionsAfter.map(a=>a.map(t)):Wr,n);if(!e.changes)return Qn.selection(r);let i=e.changes.map(t),o=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(o):o;return new Qn(i,ke.mapEffects(e.effects,t),s,e.startSelection.map(o),r)}const _Re=/^(input\.type|delete)($|\.)/;class Bi{constructor(t,n,r=0,i=void 0){this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new Bi(this.done,this.undone):this}addChanges(t,n,r,i,o){let s=this.done,a=s[s.length-1];return a&&a.changes&&!a.changes.empty&&t.changes&&(!r||_Re.test(r))&&(!a.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(o,CRe(a.changes,t.changes))||r=="input.type.compose")?s=bv(s,s.length-1,i.minDepth,new Qn(t.changes.compose(a.changes),oW(ke.mapEffects(t.effects,a.changes),a.effects),a.mapped,a.startSelection,Wr)):s=bv(s,s.length,i.minDepth,t),new Bi(s,Wr,n,r)}addSelection(t,n,r,i){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:Wr;return o.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&ARe(o[o.length-1],t)?this:new Bi(sW(this.done,t),this.undone,n,r)}addMapping(t){return new Bi(P1(this.done,t),P1(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,n,r){let i=t==0?this.done:this.undone;if(i.length==0)return null;let o=i[i.length-1],s=o.selectionsAfter[0]||(o.startSelection?o.startSelection.map(o.changes.invertedDesc,1):n.selection);if(r&&o.selectionsAfter.length)return n.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:TO.of({side:t,rest:ERe(i),selection:s}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let a=i.length==1?Wr:i.slice(0,i.length-1);return o.mapped&&(a=P1(a,o.mapped)),n.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:TO.of({side:t,rest:a,selection:s}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}Bi.empty=new Bi(Wr,Wr);const jRe=[{key:"Mod-z",run:iW,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:_O,preventDefault:!0},{linux:"Ctrl-Shift-z",run:_O,preventDefault:!0},{key:"Mod-u",run:kRe,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:ORe,preventDefault:!0}];function Kc(e,t){return V.create(e.ranges.map(t),e.mainIndex)}function xi(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function wi({state:e,dispatch:t},n){let r=Kc(e.selection,n);return r.eq(e.selection,!0)?!1:(t(xi(e,r)),!0)}function yb(e,t){return V.cursor(t?e.to:e.from)}function aW(e,t){return wi(e,n=>n.empty?e.moveByChar(n,t):yb(n,t))}function On(e){return e.textDirectionAt(e.state.selection.main.head)==Je.LTR}const lW=e=>aW(e,!On(e)),uW=e=>aW(e,On(e));function cW(e,t){return wi(e,n=>n.empty?e.moveByGroup(n,t):yb(n,t))}const MRe=e=>cW(e,!On(e)),IRe=e=>cW(e,On(e));function NRe(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function vb(e,t,n){let r=xn(e).resolveInner(t.head),i=n?Te.closedBy:Te.openedBy;for(let l=t.head;;){let u=n?r.childAfter(l):r.childBefore(l);if(!u)break;NRe(e,u,i)?r=u:l=n?u.to:u.from}let o=r.type.prop(i),s,a;return o&&(s=n?$i(e,r.from,1):$i(e,r.to,-1))&&s.matched?a=n?s.end.to:s.end.from:a=n?r.to:r.from,V.cursor(a,n?-1:1)}const RRe=e=>wi(e,t=>vb(e.state,t,!On(e))),DRe=e=>wi(e,t=>vb(e.state,t,On(e)));function fW(e,t){return wi(e,n=>{if(!n.empty)return yb(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}const hW=e=>fW(e,!1),dW=e=>fW(e,!0);function pW(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let o of e.state.facet(ie.scrollMargins)){let s=o(e);s?.top&&(n=Math.max(s?.top,n)),s?.bottom&&(r=Math.max(s?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function mW(e,t){let n=pW(e),{state:r}=e,i=Kc(r.selection,s=>s.empty?e.moveVertically(s,t,n.height):yb(s,t));if(i.eq(r.selection))return!1;let o;if(n.selfScroll){let s=e.coordsAtPos(r.selection.main.head),a=e.scrollDOM.getBoundingClientRect(),l=a.top+n.marginTop,u=a.bottom-n.marginBottom;s&&s.top>l&&s.bottom<u&&(o=ie.scrollIntoView(i.main.head,{y:"start",yMargin:s.top-l}))}return e.dispatch(xi(r,i),{effects:o}),!0}const GR=e=>mW(e,!1),jO=e=>mW(e,!0);function Gs(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let o=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;o&&t.head!=r.from+o&&(i=V.cursor(r.from+o))}return i}const LRe=e=>wi(e,t=>Gs(e,t,!0)),$Re=e=>wi(e,t=>Gs(e,t,!1)),BRe=e=>wi(e,t=>Gs(e,t,!On(e))),FRe=e=>wi(e,t=>Gs(e,t,On(e))),zRe=e=>wi(e,t=>V.cursor(e.lineBlockAt(t.head).from,1)),WRe=e=>wi(e,t=>V.cursor(e.lineBlockAt(t.head).to,-1));function URe(e,t,n){let r=!1,i=Kc(e.selection,o=>{let s=$i(e,o.head,-1)||$i(e,o.head,1)||o.head>0&&$i(e,o.head-1,1)||o.head<e.doc.length&&$i(e,o.head+1,-1);if(!s||!s.end)return o;r=!0;let a=s.start.from==o.head?s.end.to:s.end.from;return V.cursor(a)});return r?(t(xi(e,i)),!0):!1}const HRe=({state:e,dispatch:t})=>URe(e,t);function Zr(e,t){let n=Kc(e.state.selection,r=>{let i=t(r);return V.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0,i.assoc)});return n.eq(e.state.selection)?!1:(e.dispatch(xi(e.state,n)),!0)}function gW(e,t){return Zr(e,n=>e.moveByChar(n,t))}const yW=e=>gW(e,!On(e)),vW=e=>gW(e,On(e));function bW(e,t){return Zr(e,n=>e.moveByGroup(n,t))}const VRe=e=>bW(e,!On(e)),qRe=e=>bW(e,On(e)),KRe=e=>Zr(e,t=>vb(e.state,t,!On(e))),GRe=e=>Zr(e,t=>vb(e.state,t,On(e)));function xW(e,t){return Zr(e,n=>e.moveVertically(n,t))}const wW=e=>xW(e,!1),SW=e=>xW(e,!0);function kW(e,t){return Zr(e,n=>e.moveVertically(n,t,pW(e).height))}const QR=e=>kW(e,!1),XR=e=>kW(e,!0),QRe=e=>Zr(e,t=>Gs(e,t,!0)),XRe=e=>Zr(e,t=>Gs(e,t,!1)),YRe=e=>Zr(e,t=>Gs(e,t,!On(e))),ZRe=e=>Zr(e,t=>Gs(e,t,On(e))),JRe=e=>Zr(e,t=>V.cursor(e.lineBlockAt(t.head).from)),eDe=e=>Zr(e,t=>V.cursor(e.lineBlockAt(t.head).to)),YR=({state:e,dispatch:t})=>(t(xi(e,{anchor:0})),!0),ZR=({state:e,dispatch:t})=>(t(xi(e,{anchor:e.doc.length})),!0),JR=({state:e,dispatch:t})=>(t(xi(e,{anchor:e.selection.main.anchor,head:0})),!0),eD=({state:e,dispatch:t})=>(t(xi(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),tDe=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),nDe=({state:e,dispatch:t})=>{let n=bb(e).map(({from:r,to:i})=>V.range(r,Math.min(i+1,e.doc.length)));return t(e.update({selection:V.create(n),userEvent:"select"})),!0},rDe=({state:e,dispatch:t})=>{let n=Kc(e.selection,r=>{let i=xn(e),o=i.resolveStack(r.from,1);if(r.empty){let s=i.resolveStack(r.from,-1);s.node.from>=o.node.from&&s.node.to<=o.node.to&&(o=s)}for(let s=o;s;s=s.next){let{node:a}=s;if((a.from<r.from&&a.to>=r.to||a.to>r.to&&a.from<=r.from)&&s.next)return V.range(a.to,a.from)}return r});return n.eq(e.selection)?!1:(t(xi(e,n)),!0)};function OW(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let o of n.selection.ranges){let s=n.doc.lineAt(o.head);if(t?s.to<e.state.doc.length:s.from>0)for(let a=o;;){let l=e.moveVertically(a,t);if(l.head<s.from||l.head>s.to){i.some(u=>u.head==l.head)||i.push(l);break}else{if(l.head==a.head)break;a=l}}}return i.length==r.ranges.length?!1:(e.dispatch(xi(n,V.create(i,i.length-1))),!0)}const iDe=e=>OW(e,!1),oDe=e=>OW(e,!0),sDe=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=V.create([n.main]):n.main.empty||(r=V.create([V.cursor(n.main.head)])),r?(t(xi(e,r)),!0):!1};function pp(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,i=r.changeByRange(o=>{let{from:s,to:a}=o;if(s==a){let l=t(o);l<s?(n="delete.backward",l=Am(e,l,!1)):l>s&&(n="delete.forward",l=Am(e,l,!0)),s=Math.min(s,l),a=Math.max(a,l)}else s=Am(e,s,!1),a=Am(e,a,!0);return s==a?{range:o}:{changes:{from:s,to:a},range:V.cursor(s,s<o.head?-1:1)}});return i.changes.empty?!1:(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?ie.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function Am(e,t,n){if(e instanceof ie)for(let r of e.state.facet(ie.atomicRanges).map(i=>i(e)))r.between(t,t,(i,o)=>{i<t&&o>t&&(t=n?o:i)});return t}const CW=(e,t,n)=>pp(e,r=>{let i=r.from,{state:o}=e,s=o.doc.lineAt(i),a,l;if(n&&!t&&i>s.from&&i<s.from+200&&!/[^ \t]/.test(a=s.text.slice(0,i-s.from))){if(a[a.length-1]==" ")return i-1;let u=qc(a,o.tabSize),c=u%gv(o)||gv(o);for(let f=0;f<c&&a[a.length-1-f]==" ";f++)i--;l=i}else l=Jt(s.text,i-s.from,t,t)+s.from,l==i&&s.number!=(t?o.doc.lines:1)?l+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(s.text.slice(l-s.from,i-s.from))&&(l=Jt(s.text,l-s.from,!1,!1)+s.from);return l}),MO=e=>CW(e,!1,!0),AW=e=>CW(e,!0,!1),PW=(e,t)=>pp(e,n=>{let r=n.head,{state:i}=e,o=i.doc.lineAt(r),s=i.charCategorizer(r);for(let a=null;;){if(r==(t?o.to:o.from)){r==n.head&&o.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let l=Jt(o.text,r-o.from,t)+o.from,u=o.text.slice(Math.min(r,l)-o.from,Math.max(r,l)-o.from),c=s(u);if(a!=null&&c!=a)break;(u!=" "||r!=n.head)&&(a=c),r=l}return r}),EW=e=>PW(e,!1),aDe=e=>PW(e,!0),lDe=e=>pp(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),uDe=e=>pp(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),cDe=e=>pp(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),fDe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Re.of(["",""])},range:V.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},hDe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{if(!r.empty||r.from==0||r.from==e.doc.length)return{range:r};let i=r.from,o=e.doc.lineAt(i),s=i==o.from?i-1:Jt(o.text,i-o.from,!1)+o.from,a=i==o.to?i+1:Jt(o.text,i-o.from,!0)+o.from;return{changes:{from:s,to:a,insert:e.doc.slice(i,a).append(e.doc.slice(s,i))},range:V.cursor(a)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function bb(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),o=e.doc.lineAt(r.to);if(!r.empty&&r.to==o.from&&(o=e.doc.lineAt(r.to-1)),n>=i.number){let s=t[t.length-1];s.to=o.to,s.ranges.push(r)}else t.push({from:i.from,to:o.to,ranges:[r]});n=o.number+1}return t}function TW(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let o of bb(e)){if(n?o.to==e.doc.length:o.from==0)continue;let s=e.doc.lineAt(n?o.to+1:o.from-1),a=s.length+1;if(n){r.push({from:o.to,to:s.to},{from:o.from,insert:s.text+e.lineBreak});for(let l of o.ranges)i.push(V.range(Math.min(e.doc.length,l.anchor+a),Math.min(e.doc.length,l.head+a)))}else{r.push({from:s.from,to:o.from},{from:o.to,insert:e.lineBreak+s.text});for(let l of o.ranges)i.push(V.range(l.anchor-a,l.head-a))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:V.create(i,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const dDe=({state:e,dispatch:t})=>TW(e,t,!1),pDe=({state:e,dispatch:t})=>TW(e,t,!0);function _W(e,t,n){if(e.readOnly)return!1;let r=[];for(let o of bb(e))n?r.push({from:o.from,insert:e.doc.slice(o.from,o.to)+e.lineBreak}):r.push({from:o.to,insert:e.lineBreak+e.doc.slice(o.from,o.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const mDe=({state:e,dispatch:t})=>_W(e,t,!1),gDe=({state:e,dispatch:t})=>_W(e,t,!0),yDe=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(bb(t).map(({from:i,to:o})=>(i>0?i--:o<t.doc.length&&o++,{from:i,to:o}))),r=Kc(t.selection,i=>{let o;if(e.lineWrapping){let s=e.lineBlockAt(i.head),a=e.coordsAtPos(i.head,i.assoc||1);a&&(o=s.bottom+e.documentTop-a.bottom+e.defaultLineHeight/2)}return e.moveVertically(i,!0,o)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function vDe(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=xn(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),o;return r&&i&&r.to<=t&&i.from>=t&&(o=r.type.prop(Te.closedBy))&&o.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const tD=jW(!1),bDe=jW(!0);function jW(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(i=>{let{from:o,to:s}=i,a=t.doc.lineAt(o),l=!e&&o==s&&vDe(t,o);e&&(o=s=(s<=a.to?a:t.doc.lineAt(s)).to);let u=new pb(t,{simulateBreak:o,simulateDoubleBreak:!!l}),c=YP(u,o);for(c==null&&(c=qc(/^\s*/.exec(t.doc.lineAt(o).text)[0],t.tabSize));s<a.to&&/\s/.test(a.text[s-a.from]);)s++;l?{from:o,to:s}=l:o>a.from&&o<a.from+100&&!/\S/.test(a.text.slice(0,o))&&(o=a.from);let f=["",$d(t,c)];return l&&f.push($d(t,u.lineIndent(a.from,-1))),{changes:{from:o,to:s,insert:Re.of(f)},range:V.cursor(o+1+f[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function tE(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let s=r.from;s<=r.to;){let a=e.doc.lineAt(s);a.number>n&&(r.empty||r.to>a.from)&&(t(a,i,r),n=a.number),s=a.to+1}let o=e.changes(i);return{changes:i,range:V.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}const xDe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new pb(e,{overrideIndentation:o=>{let s=n[o];return s??-1}}),i=tE(e,(o,s,a)=>{let l=YP(r,o.from);if(l==null)return;/\S/.test(o.text)||(l=0);let u=/^\s*/.exec(o.text)[0],c=$d(e,l);(u!=c||a.from<o.from+u.length)&&(n[o.from]=l,s.push({from:o.from,to:o.from+u.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:"indent"})),!0},MW=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(tE(e,(n,r)=>{r.push({from:n.from,insert:e.facet(db)})}),{userEvent:"input.indent"})),!0),IW=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(tE(e,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let o=qc(i,e.tabSize),s=0,a=$d(e,Math.max(0,o-gv(e)));for(;s<i.length&&s<a.length&&i.charCodeAt(s)==a.charCodeAt(s);)s++;r.push({from:n.from+s,to:n.from+i.length,insert:a.slice(s)})}),{userEvent:"delete.dedent"})),!0),wDe=e=>(e.setTabFocusMode(),!0),SDe=[{key:"Ctrl-b",run:lW,shift:yW,preventDefault:!0},{key:"Ctrl-f",run:uW,shift:vW},{key:"Ctrl-p",run:hW,shift:wW},{key:"Ctrl-n",run:dW,shift:SW},{key:"Ctrl-a",run:zRe,shift:JRe},{key:"Ctrl-e",run:WRe,shift:eDe},{key:"Ctrl-d",run:AW},{key:"Ctrl-h",run:MO},{key:"Ctrl-k",run:lDe},{key:"Ctrl-Alt-h",run:EW},{key:"Ctrl-o",run:fDe},{key:"Ctrl-t",run:hDe},{key:"Ctrl-v",run:jO}],kDe=[{key:"ArrowLeft",run:lW,shift:yW,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:MRe,shift:VRe,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:BRe,shift:YRe,preventDefault:!0},{key:"ArrowRight",run:uW,shift:vW,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:IRe,shift:qRe,preventDefault:!0},{mac:"Cmd-ArrowRight",run:FRe,shift:ZRe,preventDefault:!0},{key:"ArrowUp",run:hW,shift:wW,preventDefault:!0},{mac:"Cmd-ArrowUp",run:YR,shift:JR},{mac:"Ctrl-ArrowUp",run:GR,shift:QR},{key:"ArrowDown",run:dW,shift:SW,preventDefault:!0},{mac:"Cmd-ArrowDown",run:ZR,shift:eD},{mac:"Ctrl-ArrowDown",run:jO,shift:XR},{key:"PageUp",run:GR,shift:QR},{key:"PageDown",run:jO,shift:XR},{key:"Home",run:$Re,shift:XRe,preventDefault:!0},{key:"Mod-Home",run:YR,shift:JR},{key:"End",run:LRe,shift:QRe,preventDefault:!0},{key:"Mod-End",run:ZR,shift:eD},{key:"Enter",run:tD,shift:tD},{key:"Mod-a",run:tDe},{key:"Backspace",run:MO,shift:MO,preventDefault:!0},{key:"Delete",run:AW,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:EW,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:aDe,preventDefault:!0},{mac:"Mod-Backspace",run:uDe,preventDefault:!0},{mac:"Mod-Delete",run:cDe,preventDefault:!0}].concat(SDe.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),ODe=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:RRe,shift:KRe},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:DRe,shift:GRe},{key:"Alt-ArrowUp",run:dDe},{key:"Shift-Alt-ArrowUp",run:mDe},{key:"Alt-ArrowDown",run:pDe},{key:"Shift-Alt-ArrowDown",run:gDe},{key:"Mod-Alt-ArrowUp",run:iDe},{key:"Mod-Alt-ArrowDown",run:oDe},{key:"Escape",run:sDe},{key:"Mod-Enter",run:bDe},{key:"Alt-l",mac:"Ctrl-l",run:nDe},{key:"Mod-i",run:rDe,preventDefault:!0},{key:"Mod-[",run:IW},{key:"Mod-]",run:MW},{key:"Mod-Alt-\\",run:xDe},{key:"Shift-Mod-k",run:yDe},{key:"Shift-Mod-\\",run:HRe},{key:"Mod-/",run:dRe},{key:"Alt-A",run:mRe},{key:"Ctrl-m",mac:"Shift-Alt-m",run:wDe}].concat(kDe),CDe={key:"Tab",run:MW,shift:IW},nD=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class wc{constructor(t,n,r=0,i=t.length,o,s){this.test=s,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(r,i),this.bufferStart=r,this.normalize=o?a=>o(nD(a)):nD,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return zn(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let n=EP(t),r=this.bufferStart+this.bufferPos;this.bufferPos+=Ni(t);let i=this.normalize(n);if(i.length)for(let o=0,s=r,a=!0;;o++){let l=i.charCodeAt(o),u=this.match(l,s,a,this.bufferPos+this.bufferStart,o==i.length-1);if(u)return this.value=u,this;if(o==i.length-1)break;a&&o<n.length&&n.charCodeAt(o)==l?s++:a=!1}}}match(t,n,r,i,o){let s=null;for(let a=0;a<this.matches.length;){let l=this.matches[a],u=!1;this.query.charCodeAt(l.index)==t&&(l.index==this.query.length-1?s={from:l.from,to:i,precise:o&&l.precise}:(l.index++,u=!0)),u?a++:this.matches.splice(a,1)}return this.query.charCodeAt(0)==t&&(this.query.length==1?s={from:n,to:i,precise:r&&o}:this.matches.push({from:n,index:1,precise:r})),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(wc.prototype[Symbol.iterator]=function(){return this});const NW={from:-1,to:-1,match:/.*/.exec(""),precise:!0},nE="gm"+(/x/.unicode==null?"":"u");class RW{constructor(t,n,r,i=0,o=t.length){if(this.text=t,this.to=o,this.curLine="",this.done=!1,this.value=NW,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new DW(t,n,r,i,o);this.re=new RegExp(n,nE+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=t.iter();let s=t.lineAt(i);this.curLineStart=s.from,this.matchPos=xv(t,i),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,i=r+n[0].length;if(this.matchPos=xv(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<i||r>this.value.to)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,precise:!0,match:n},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),t=0;else return this.done=!0,this}}}const E1=new WeakMap;class Tu{constructor(t,n){this.from=t,this.text=n}get to(){return this.from+this.text.length}static get(t,n,r){let i=E1.get(t);if(!i||i.from>=r||i.to<=n){let a=new Tu(n,t.sliceString(n,r));return E1.set(t,a),a}if(i.from==n&&i.to==r)return i;let{text:o,from:s}=i;return s>n&&(o=t.sliceString(n,s)+o,s=n),i.to<r&&(o+=t.sliceString(i.to,r)),E1.set(t,new Tu(s,o)),new Tu(n,o.slice(n-s,r-s))}}class DW{constructor(t,n,r,i,o){this.text=t,this.to=o,this.done=!1,this.value=NW,this.matchPos=xv(t,i),this.re=new RegExp(n,nE+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=Tu.get(t,i,this.chunkEnd(i+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,i=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,precise:!0,match:n},this.matchPos=xv(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Tu.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(RW.prototype[Symbol.iterator]=DW.prototype[Symbol.iterator]=function(){return this});function ADe(e){try{return new RegExp(e,nE),!0}catch{return!1}}function xv(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}const PDe=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:i}=qIe(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:t.phrase("go")});return i.then(o=>{let s=o&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(o.elements.line.value);if(!s){e.dispatch({effects:r});return}let a=t.doc.lineAt(t.selection.main.head),[,l,u,c,f]=s,h=c?+c.slice(1):0,d=u?+u:a.number;if(u&&f){let v=d/100;l&&(v=v*(l=="-"?-1:1)+a.number/t.doc.lines),d=Math.round(t.doc.lines*v)}else u&&l&&(d=d*(l=="-"?-1:1)+a.number);let p=t.doc.line(Math.max(1,Math.min(t.doc.lines,d))),m=V.cursor(p.from+Math.max(0,Math.min(h,p.length)));e.dispatch({effects:[r,ie.scrollIntoView(m.from,{y:"center"})],selection:m})}),!0},EDe={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},TDe=se.define({combine(e){return Ji(e,EDe,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function _De(e){return[RDe,NDe]}const jDe=de.mark({class:"cm-selectionMatch"}),MDe=de.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function rD(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=yt.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=yt.Word)}function IDe(e,t,n,r){return e(t.sliceDoc(n,n+1))==yt.Word&&e(t.sliceDoc(r-1,r))==yt.Word}const NDe=Et.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(TDe),{state:n}=e,r=n.selection;if(r.ranges.length>1)return de.none;let i=r.main,o,s=null;if(i.empty){if(!t.highlightWordAroundCursor)return de.none;let l=n.wordAt(i.head);if(!l)return de.none;s=n.charCategorizer(i.head),o=n.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l<t.minSelectionLength||l>200)return de.none;if(t.wholeWords){if(o=n.sliceDoc(i.from,i.to),s=n.charCategorizer(i.head),!(rD(s,n,i.from,i.to)&&IDe(s,n,i.from,i.to)))return de.none}else if(o=n.sliceDoc(i.from,i.to),!o)return de.none}let a=[];for(let l of e.visibleRanges){let u=new wc(n.doc,o,l.from,l.to);for(;!u.next().done;){let{from:c,to:f}=u.value;if((!s||rD(s,n,c,f))&&(i.empty&&c<=i.from&&f>=i.to?a.push(MDe.range(c,f)):(c>=i.to||f<=i.from)&&a.push(jDe.range(c,f)),a.length>t.maxMatches))return de.none}}return de.set(a)}},{decorations:e=>e.decorations}),RDe=ie.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),DDe=({state:e,dispatch:t})=>{let{selection:n}=e,r=V.create(n.ranges.map(i=>e.wordAt(i.head)||V.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function LDe(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),o=i&&i.from==n.from&&i.to==n.to;for(let s=!1,a=new wc(e.doc,t,r[r.length-1].to);;)if(a.next(),a.done){if(s)return null;a=new wc(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),s=!0}else{if(s&&r.some(l=>l.from==a.value.from))continue;if(o){let l=e.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const $De=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(o=>o.from===o.to))return DDe({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(o=>e.sliceDoc(o.from,o.to)!=r))return!1;let i=LDe(e,r);return i?(t(e.update({selection:e.selection.addRange(V.range(i.from,i.to),!1),effects:ie.scrollIntoView(i.to)})),!0):!1},Gc=se.define({combine(e){return Ji(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new ZDe(t),scrollToMatch:t=>ie.scrollIntoView(t)})}});class LW{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||ADe(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord,this.test=t.test}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?`
|
|
440
|
-
`:r=="r"?"\r":r=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord&&this.test==t.test}create(){return this.regexp?new HDe(this):new zDe(this)}getCursor(t,n=0,r){let i=t.doc?t:Ne.create({doc:t});return r==null&&(r=i.doc.length),this.regexp?Fl(this,i,n,r):Bl(this,i,n,r)}}class $W{constructor(t){this.spec=t}}function BDe(e,t,n){return(r,i,o,s)=>{if(n&&!n(r,i,o,s))return!1;let a=r>=s&&i<=s+o.length?o.slice(r-s,i-s):t.doc.sliceString(r,i);return e(a,t,r,i)}}function Bl(e,t,n,r){let i;return e.wholeWord&&(i=FDe(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=BDe(e.test,t,i)),new wc(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:o=>o.toLowerCase(),i)}function FDe(e,t){return(n,r,i,o)=>((o>n||o+i.length<r)&&(o=Math.max(0,n-2),i=e.sliceString(o,Math.min(e.length,r+2))),(t(wv(i,n-o))!=yt.Word||t(Sv(i,n-o))!=yt.Word)&&(t(Sv(i,r-o))!=yt.Word||t(wv(i,r-o))!=yt.Word))}class zDe extends $W{constructor(t){super(t)}nextMatch(t,n,r){let i=Bl(this.spec,t,r,t.doc.length).nextOverlapping();if(i.done){let o=Math.min(t.doc.length,n+this.spec.unquoted.length);i=Bl(this.spec,t,0,o).nextOverlapping()}return i.done||i.value.from==n&&i.value.to==r?null:i.value}prevMatchInRange(t,n,r){for(let i=r;;){let o=Math.max(n,i-1e4-this.spec.unquoted.length),s=Bl(this.spec,t,o,i),a=null;for(;!s.nextOverlapping().done;)a=s.value;if(a)return a;if(o==n)return null;i-=1e4}}prevMatch(t,n,r){let i=this.prevMatchInRange(t,0,n);return i||(i=this.prevMatchInRange(t,Math.max(0,r-this.spec.unquoted.length),t.doc.length)),i&&(i.from!=n||i.to!=r)?i:null}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,n){let r=Bl(this.spec,t,0,t.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(t,n,r,i){let o=Bl(this.spec,t,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,t.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}function WDe(e,t,n){return(r,i,o)=>(!n||n(r,i,o))&&e(o[0],t,r,i)}function Fl(e,t,n,r){let i;return e.wholeWord&&(i=UDe(t.charCategorizer(t.selection.main.head))),e.test&&(i=WDe(e.test,t,i)),new RW(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function wv(e,t){return e.slice(Jt(e,t,!1),t)}function Sv(e,t){return e.slice(t,Jt(e,t))}function UDe(e){return(t,n,r)=>!r[0].length||(e(wv(r.input,r.index))!=yt.Word||e(Sv(r.input,r.index))!=yt.Word)&&(e(Sv(r.input,r.index+r[0].length))!=yt.Word||e(wv(r.input,r.index+r[0].length))!=yt.Word)}class HDe extends $W{nextMatch(t,n,r){let i=Fl(this.spec,t,r,t.doc.length).next();return i.done&&(i=Fl(this.spec,t,0,n).next()),i.done?null:i.value}prevMatchInRange(t,n,r){for(let i=1;;i++){let o=Math.max(n,r-i*1e4),s=Fl(this.spec,t,o,r),a=null;for(;!s.next().done;)a=s.value;if(a&&(o==n||a.from>o+10))return a;if(o==n)return null}}prevMatch(t,n,r){return this.prevMatchInRange(t,0,n)||this.prevMatchInRange(t,r,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,r)=>{if(r=="&")return t.match[0];if(r=="$")return"$";for(let i=r.length;i>0;i--){let o=+r.slice(0,i);if(o>0&&o<t.match.length)return t.match[o]+r.slice(i)}return n})}matchAll(t,n){let r=Fl(this.spec,t,0,t.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(t,n,r,i){let o=Fl(this.spec,t,Math.max(0,n-250),Math.min(r+250,t.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}const Bd=ke.define(),rE=ke.define(),Os=kn.define({create(e){return new T1(IO(e).create(),null)},update(e,t){for(let n of t.effects)n.is(Bd)?e=new T1(n.value.create(),e.panel):n.is(rE)&&(e=new T1(e.query,n.value?iE:null));return e},provide:e=>Rd.from(e,t=>t.panel)});class T1{constructor(t,n){this.query=t,this.panel=n}}const VDe=de.mark({class:"cm-searchMatch"}),qDe=de.mark({class:"cm-searchMatch cm-searchMatch-selected"}),KDe=Et.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Os))}update(e){let t=e.state.field(Os);(t!=e.startState.field(Os)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return de.none;let{view:n}=this,r=new Io;for(let i=0,o=n.visibleRanges,s=o.length;i<s;i++){let{from:a,to:l}=o[i];for(;i<s-1&&l>o[i+1].from-2*250;)l=o[++i].to;e.highlight(n.state,a,l,(u,c)=>{let f=n.state.selection.ranges.some(h=>h.from==u&&h.to==c);r.add(u,c,f?qDe:VDe)})}return r.finish()}},{decorations:e=>e.decorations});function mp(e){return t=>{let n=t.state.field(Os,!1);return n&&n.query.spec.valid?e(t,n):zW(t)}}const kv=mp((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=V.single(r.from,r.to),o=e.state.facet(Gc);return e.dispatch({selection:i,effects:[oE(e,r),o.scrollToMatch(i.main,e)],userEvent:"select.search"}),FW(e),!0}),Ov=mp((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let o=V.single(i.from,i.to),s=e.state.facet(Gc);return e.dispatch({selection:o,effects:[oE(e,i),s.scrollToMatch(o.main,e)],userEvent:"select.search"}),FW(e),!0}),GDe=mp((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:V.create(n.map(r=>V.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),QDe=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,o=[],s=0;for(let a=new wc(e.doc,e.sliceDoc(r,i));!a.next().done;){if(o.length>1e3)return!1;a.value.from==r&&(s=o.length),o.push(V.range(a.value.from,a.value.to))}return t(e.update({selection:V.create(o,s),userEvent:"select.search.matches"})),!0},iD=mp((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let o=t.nextMatch(n,r,r);if(!o)return!1;let s=o,a=[],l,u,c=[];s.precise?s.from==r&&s.to==i&&(u=n.toText(t.getReplacement(s)),a.push({from:s.from,to:s.to,insert:u}),c.push(ie.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))):s=t.nextMatch(n,s.from,s.to);let f=e.state.changes(a);return s&&(l=V.single(s.from,s.to).map(f),c.push(oE(e,s)),c.push(n.facet(Gc).scrollToMatch(l.main,e))),e.dispatch({changes:f,selection:l,effects:c,userEvent:"input.replace"}),!0}),XDe=mp((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let i of t.matchAll(e.state,1e9)){let{from:o,to:s,precise:a}=i;a&&n.push({from:o,to:s,insert:t.getReplacement(i)})}if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:ie.announce.of(r),userEvent:"input.replace.all"}),!0});function iE(e){return e.state.facet(Gc).createPanel(e)}function IO(e,t){var n,r,i,o,s;let a=e.selection.main,l=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!l)return t;let u=e.facet(Gc);return new LW({search:((n=t?.literal)!==null&&n!==void 0?n:u.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(r=t?.caseSensitive)!==null&&r!==void 0?r:u.caseSensitive,literal:(i=t?.literal)!==null&&i!==void 0?i:u.literal,regexp:(o=t?.regexp)!==null&&o!==void 0?o:u.regexp,wholeWord:(s=t?.wholeWord)!==null&&s!==void 0?s:u.wholeWord})}function BW(e){let t=qP(e,iE);return t&&t.dom.querySelector("[main-field]")}function FW(e){let t=BW(e);t&&t==e.root.activeElement&&t.select()}const zW=e=>{let t=e.state.field(Os,!1);if(t&&t.panel){let n=BW(e);if(n&&n!=e.root.activeElement){let r=IO(e.state,t.query.spec);r.valid&&e.dispatch({effects:Bd.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[rE.of(!0),t?Bd.of(IO(e.state,t.query.spec)):ke.appendConfig.of(eLe)]});return!0},WW=e=>{let t=e.state.field(Os,!1);if(!t||!t.panel)return!1;let n=qP(e,iE);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:rE.of(!1)}),!0},YDe=[{key:"Mod-f",run:zW,scope:"editor search-panel"},{key:"F3",run:kv,shift:Ov,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:kv,shift:Ov,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:WW,scope:"editor search-panel"},{key:"Mod-Shift-l",run:QDe},{key:"Mod-Alt-g",run:PDe},{key:"Mod-d",run:$De,preventDefault:!0}];class ZDe{constructor(t){this.view=t;let n=this.query=t.state.field(Os).query.spec;this.commit=this.commit.bind(this),this.searchField=Ke("input",{value:n.search,placeholder:lr(t,"Find"),"aria-label":lr(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Ke("input",{value:n.replace,placeholder:lr(t,"Replace"),"aria-label":lr(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Ke("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Ke("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Ke("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,o,s){return Ke("button",{class:"cm-button",name:i,onclick:o,type:"button"},s)}this.dom=Ke("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>kv(t),[lr(t,"next")]),r("prev",()=>Ov(t),[lr(t,"previous")]),r("select",()=>GDe(t),[lr(t,"all")]),Ke("label",null,[this.caseField,lr(t,"match case")]),Ke("label",null,[this.reField,lr(t,"regexp")]),Ke("label",null,[this.wordField,lr(t,"by word")]),...t.state.readOnly?[]:[Ke("br"),this.replaceField,r("replace",()=>iD(t),[lr(t,"replace")]),r("replaceAll",()=>XDe(t),[lr(t,"replace all")])],Ke("button",{name:"close",onclick:()=>WW(t),"aria-label":lr(t,"close"),type:"button"},["×"])])}commit(){let t=new LW({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:Bd.of(t)}))}keydown(t){nIe(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?Ov:kv)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),iD(this.view))}update(t){for(let n of t.transactions)for(let r of n.effects)r.is(Bd)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Gc).top}}function lr(e,t){return e.state.phrase(t)}const Pm=30,Em=/[\s\.,:;?!]/;function oE(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,o=Math.max(r.from,t-Pm),s=Math.min(i,n+Pm),a=e.state.sliceDoc(o,s);if(o!=r.from){for(let l=0;l<Pm;l++)if(!Em.test(a[l+1])&&Em.test(a[l])){a=a.slice(l);break}}if(s!=i){for(let l=a.length-1;l>a.length-Pm;l--)if(!Em.test(a[l-1])&&Em.test(a[l])){a=a.slice(0,l);break}}return ie.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${r.number}.`)}const JDe=ie.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),eLe=[Os,bl.low(KDe),JDe];class UW{constructor(t,n,r,i){this.state=t,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let n=xn(this.state).resolveInner(this.pos,-1);for(;n&&t.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(t){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),o=i.search(HW(t,!1));return o<0?null:{from:r+o,to:this.pos,text:i.slice(o)}}get aborted(){return this.abortListeners==null}addEventListener(t,n,r){t=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function oD(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function tLe(e){let t=Object.create(null),n=Object.create(null);for(let{label:i}of e){t[i[0]]=!0;for(let o=1;o<i.length;o++)n[i[o]]=!0}let r=oD(t)+oD(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function nLe(e){let t=e.map(i=>typeof i=="string"?{label:i}:i),[n,r]=t.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:tLe(t);return i=>{let o=i.matchBefore(r);return o||i.explicit?{from:o?o.from:i.pos,options:t,validFor:n}:null}}class sD{constructor(t,n,r,i){this.completion=t,this.source=n,this.match=r,this.score=i}}function Wa(e){return e.selection.main.from}function HW(e,t){var n;let{source:r}=e,i=t&&r[0]!="^",o=r[r.length-1]!="$";return!i&&!o?e:new RegExp(`${i?"^":""}(?:${r})${o?"$":""}`,(n=e.flags)!==null&&n!==void 0?n:e.ignoreCase?"i":"")}const VW=Zi.define();function rLe(e,t,n,r){let{main:i}=e.selection,o=n-i.from,s=r-i.from;return{...e.changeByRange(a=>{if(a!=i&&n!=r&&e.sliceDoc(a.from+o,a.from+s)!=e.sliceDoc(n,r))return{range:a};let l=e.toText(t);return{changes:{from:a.from+o,to:r==i.from?a.to:a.from+s,insert:l},range:V.cursor(a.from+o+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const aD=new WeakMap;function iLe(e){if(!Array.isArray(e))return e;let t=aD.get(e);return t||aD.set(e,t=nLe(e)),t}const Cv=ke.define(),Fd=ke.define();class oLe{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n<t.length;){let r=zn(t,n),i=Ni(r);this.chars.push(r);let o=t.slice(n,n+i),s=o.toUpperCase();this.folded.push(zn(s==o?o.toLowerCase():s,0)),n+=i}this.astral=t.length!=this.chars.length}ret(t,n){return this.score=t,this.matched=n,this}match(t){if(this.pattern.length==0)return this.ret(-100,[]);if(t.length<this.pattern.length)return null;let{chars:n,folded:r,any:i,precise:o,byWord:s}=this;if(n.length==1){let y=zn(t,0),x=Ni(y),k=x==t.length?0:-100;if(y!=n[0])if(y==r[0])k+=-200;else return null;return this.ret(k,[0,x])}let a=t.indexOf(this.pattern);if(a==0)return this.ret(t.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=n.length,u=0;if(a<0){for(let y=0,x=Math.min(t.length,200);y<x&&u<l;){let k=zn(t,y);(k==n[u]||k==r[u])&&(i[u++]=y),y+=Ni(k)}if(u<l)return null}let c=0,f=0,h=!1,d=0,p=-1,m=-1,v=/[a-z]/.test(t),b=!0;for(let y=0,x=Math.min(t.length,200),k=0;y<x&&f<l;){let w=zn(t,y);a<0&&(c<l&&w==n[c]&&(o[c++]=y),d<l&&(w==n[d]||w==r[d]?(d==0&&(p=y),m=y+1,d++):d=0));let S,O=w<255?w>=48&&w<=57||w>=97&&w<=122?2:w>=65&&w<=90?1:0:(S=EP(w))!=S.toLowerCase()?1:S!=S.toUpperCase()?2:0;(!y||O==1&&v||k==0&&O!=0)&&(n[f]==w||r[f]==w&&(h=!0)?s[f++]=y:s.length&&(b=!1)),k=O,y+=Ni(w)}return f==l&&s[0]==0&&b?this.result(-100+(h?-200:0),s,t):d==l&&p==0?this.ret(-200-t.length+(m==t.length?0:-100),[0,m]):a>-1?this.ret(-700-t.length,[a,a+this.pattern.length]):d==l?this.ret(-900-t.length,[p,m]):f==l?this.result(-100+(h?-200:0)+-700+(b?0:-1100),s,t):n.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,t)}result(t,n,r){let i=[],o=0;for(let s of n){let a=s+(this.astral?Ni(zn(r,s)):1);o&&i[o-1]==s?i[o-1]=a:(i[o++]=s,i[o++]=a)}return this.ret(t-r.length,i)}}class sLe{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length<this.pattern.length)return null;let n=t.slice(0,this.pattern.length),r=n==this.pattern?0:n.toLowerCase()==this.folded?-200:null;return r==null?null:(this.matched=[0,n.length],this.score=r+(t.length==this.pattern.length?0:-100),this)}}const Zt=se.define({combine(e){return Ji(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:aLe,filterStrict:!1,compareCompletions:(t,n)=>(t.sortText||t.label).localeCompare(n.sortText||n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,n)=>t&&n,closeOnBlur:(t,n)=>t&&n,icons:(t,n)=>t&&n,tooltipClass:(t,n)=>r=>lD(t(r),n(r)),optionClass:(t,n)=>r=>lD(t(r),n(r)),addToOptions:(t,n)=>t.concat(n),filterStrict:(t,n)=>t||n})}});function lD(e,t){return e?t?e+" "+t:e:t}function aLe(e,t,n,r,i,o){let s=e.textDirection==Je.RTL,a=s,l=!1,u="top",c,f,h=t.left-i.left,d=i.right-t.right,p=r.right-r.left,m=r.bottom-r.top;if(a&&h<Math.min(p,d)?a=!1:!a&&d<Math.min(p,h)&&(a=!0),p<=(a?h:d))c=Math.max(i.top,Math.min(n.top,i.bottom-m))-t.top,f=Math.min(400,a?h:d);else{l=!0,f=Math.min(400,(s?t.right:i.right-t.left)-30);let y=i.bottom-t.bottom;y>=m||y>t.top?c=n.bottom-t.top:(u="bottom",c=t.bottom-n.top)}let v=(t.bottom-t.top)/o.offsetHeight,b=(t.right-t.left)/o.offsetWidth;return{style:`${u}: ${c/v}px; max-width: ${f/b}px`,class:"cm-completionInfo-"+(l?s?"left-narrow":"right-narrow":a?"left":"right")}}const sE=ke.define();function lLe(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),t.push({render(n,r,i,o){let s=document.createElement("span");s.className="cm-completionLabel";let a=n.displayLabel||n.label,l=0;for(let u=0;u<o.length;){let c=o[u++],f=o[u++];c>l&&s.appendChild(document.createTextNode(a.slice(l,c)));let h=s.appendChild(document.createElement("span"));h.appendChild(document.createTextNode(a.slice(c,f))),h.className="cm-completionMatchedText",l=f}return l<a.length&&s.appendChild(document.createTextNode(a.slice(l))),s},position:50},{render(n){if(!n.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=n.detail,r},position:80}),t.sort((n,r)=>n.position-r.position).map(n=>n.render)}function _1(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let i=Math.floor(t/n);return{from:i*n,to:(i+1)*n}}let r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}class uLe{constructor(t,n,r){this.view=t,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let i=t.state.field(n),{options:o,selected:s}=i.open,a=t.state.facet(Zt);this.optionContent=lLe(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=_1(o.length,s,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",l=>{let{options:u}=t.state.field(n).open;for(let c=l.target,f;c&&c!=this.dom;c=c.parentNode)if(c.nodeName=="LI"&&(f=/-(\d+)$/.exec(c.id))&&+f[1]<u.length){this.applyCompletion(t,u[+f[1]]),l.preventDefault();return}if(l.target==this.list){let c=this.list.classList.contains("cm-completionListIncompleteTop")&&l.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&l.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;c!=null&&(t.dispatch({effects:sE.of(c)}),l.preventDefault())}}),this.dom.addEventListener("focusout",l=>{let u=t.state.field(this.stateField,!1);u&&u.tooltip&&t.state.facet(Zt).closeOnBlur&&l.relatedTarget!=t.contentDOM&&t.dispatch({effects:Fd.of(null)})}),this.showOptions(o,i.id)}mount(){this.updateSel()}showOptions(t,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var n;let r=t.state.field(this.stateField),i=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),r!=i){let{options:o,selected:s,disabled:a}=r.open;(!i.open||i.open.options!=o)&&(this.range=_1(o.length,s,t.state.facet(Zt).maxRenderedOptions),this.showOptions(o,r.id)),this.updateSel(),a!=((n=i.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(t){let n=this.tooltipClass(t);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),n=t.open;(n.selected>-1&&n.selected<this.range.from||n.selected>=this.range.to)&&(this.range=_1(n.options.length,n.selected,this.view.state.facet(Zt).maxRenderedOptions),this.showOptions(n.options,t.id));let r=this.updateSelectedOption(n.selected);if(r){this.destroyInfo();let{completion:i}=n.options[n.selected],{info:o}=i;if(!o)return;let s=typeof o=="string"?document.createTextNode(o):o(i);if(!s)return;"then"in s?s.then(a=>{a&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(a,i)}).catch(a=>Gn(this.view.state,a,"completion info")):(this.addInfoPane(s,i),r.setAttribute("aria-describedby",this.info.id))}}addInfoPane(t,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",r.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),t.nodeType!=null)r.appendChild(t),this.infoDestroy=null;else{let{dom:i,destroy:o}=t;r.appendChild(i),this.infoDestroy=o||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let n=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==t?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&(r.removeAttribute("aria-selected"),r.removeAttribute("aria-describedby"));return n&&fLe(this.list,n),n}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=t.getBoundingClientRect(),o=this.space;if(!o){let s=this.dom.ownerDocument.documentElement;o={left:0,top:0,right:s.clientWidth,bottom:s.clientHeight}}return i.top>Math.min(o.bottom,n.bottom)-10||i.bottom<Math.max(o.top,n.top)+10?null:this.view.state.facet(Zt).positionInfo(this.view,n,i,r,o,this.dom)}placeInfo(t){this.info&&(t?(t.style&&(this.info.style.cssText=t.style),this.info.className="cm-tooltip cm-completionInfo "+(t.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(t,n,r){const i=document.createElement("ul");i.id=n,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions")),i.addEventListener("mousedown",s=>{s.target==i&&s.preventDefault()});let o=null;for(let s=r.from;s<r.to;s++){let{completion:a,match:l}=t[s],{section:u}=a;if(u){let h=typeof u=="string"?u:u.name;if(h!=o&&(s>r.from||r.from==0))if(o=h,typeof u!="string"&&u.header)i.appendChild(u.header(u));else{let d=i.appendChild(document.createElement("completion-section"));d.textContent=h}}const c=i.appendChild(document.createElement("li"));c.id=n+"-"+s,c.setAttribute("role","option");let f=this.optionClass(a);f&&(c.className=f);for(let h of this.optionContent){let d=h(a,this.view.state,this.view,l);d&&c.appendChild(d)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.to<t.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function cLe(e,t){return n=>new uLe(n,e,t)}function fLe(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function uD(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function hLe(e,t){let n=[],r=null,i=null,o=c=>{n.push(c);let{section:f}=c.completion;if(f){r||(r=[]);let h=typeof f=="string"?f:f.name;r.some(d=>d.name==h)||r.push(typeof f=="string"?{name:h}:f)}},s=t.facet(Zt);for(let c of e)if(c.hasResult()){let f=c.result.getMatch;if(c.result.filter===!1)for(let h of c.result.options)o(new sD(h,c.source,f?f(h):[],1e9-n.length));else{let h=t.sliceDoc(c.from,c.to),d,p=s.filterStrict?new sLe(h):new oLe(h);for(let m of c.result.options)if(d=p.match(m.label)){let v=m.displayLabel?f?f(m,d.matched):[]:d.matched,b=d.score+(m.boost||0);if(o(new sD(m,c.source,v,b)),typeof m.section=="object"&&m.section.rank==="dynamic"){let{name:y}=m.section;i||(i=Object.create(null)),i[y]=Math.max(b,i[y]||-1e9)}}}}if(r){let c=Object.create(null),f=0,h=(d,p)=>(d.rank==="dynamic"&&p.rank==="dynamic"?i[p.name]-i[d.name]:0)||(typeof d.rank=="number"?d.rank:1e9)-(typeof p.rank=="number"?p.rank:1e9)||(d.name<p.name?-1:1);for(let d of r.sort(h))f-=1e5,c[d.name]=f;for(let d of n){let{section:p}=d.completion;p&&(d.score+=c[typeof p=="string"?p:p.name])}}let a=[],l=null,u=s.compareCompletions;for(let c of n.sort((f,h)=>h.score-f.score||u(f.completion,h.completion))){let f=c.completion;!l||l.label!=f.label||l.detail!=f.detail||l.type!=null&&f.type!=null&&l.type!=f.type||l.apply!=f.apply||l.boost!=f.boost?a.push(c):uD(c.completion)>uD(l)&&(a[a.length-1]=c),l=c.completion}return a}class cu{constructor(t,n,r,i,o,s){this.options=t,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=o,this.disabled=s}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new cu(this.options,cD(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,o,s){if(i&&!s&&t.some(u=>u.isPending))return i.setDisabled();let a=hLe(t,n);if(!a.length)return i&&t.some(u=>u.isPending)?i.setDisabled():null;let l=n.facet(Zt).selectOnOpen?0:-1;if(i&&i.selected!=l&&i.selected!=-1){let u=i.options[i.selected].completion;for(let c=0;c<a.length;c++)if(a[c].completion==u){l=c;break}}return new cu(a,cD(r,l),{pos:t.reduce((u,c)=>c.hasResult()?Math.min(u,c.from):u,1e8),create:vLe,above:o.aboveCursor},i?i.timestamp:Date.now(),l,!1)}map(t){return new cu(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new cu(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Av{constructor(t,n,r){this.active=t,this.id=n,this.open=r}static start(){return new Av(gLe,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(Zt),o=(r.override||n.languageDataAt("autocomplete",Wa(n)).map(iLe)).map(l=>(this.active.find(c=>c.source==l)||new Ur(l,this.active.some(c=>c.state!=0)?1:0)).update(t,r));o.length==this.active.length&&o.every((l,u)=>l==this.active[u])&&(o=this.active);let s=this.open,a=t.effects.some(l=>l.is(aE));s&&t.docChanged&&(s=s.map(t.changes)),t.selection||o.some(l=>l.hasResult()&&t.changes.touchesRange(l.from,l.to))||!dLe(o,this.active)||a?s=cu.build(o,n,this.id,s,r,a):s&&s.disabled&&!o.some(l=>l.isPending)&&(s=null),!s&&o.every(l=>!l.isPending)&&o.some(l=>l.hasResult())&&(o=o.map(l=>l.hasResult()?new Ur(l.source,0):l));for(let l of t.effects)l.is(sE)&&(s=s&&s.setSelected(l.value,this.id));return o==this.active&&s==this.open?this:new Av(o,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?pLe:mLe}}function dLe(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,o=r==t.length;if(i||o)return i==o;if(e[n++].result!=t[r++].result)return!1}}const pLe={"aria-autocomplete":"list"},mLe={};function cD(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}const gLe=[];function qW(e,t){if(e.isUserEvent("input.complete")){let r=e.annotation(VW);if(r&&t.activateOnCompletion(r))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}class Ur{constructor(t,n,r=!1){this.source=t,this.state=n,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=qW(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new Ur(i.source,0)),r&4&&i.state==0&&(i=new Ur(this.source,1)),i=i.updateFor(t,r);for(let o of t.effects)if(o.is(Cv))i=new Ur(i.source,1,o.value);else if(o.is(Fd))i=new Ur(i.source,0);else if(o.is(aE))for(let s of o.value)s.source==i.source&&(i=s);return i}updateFor(t,n){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(Wa(t.state))}}class _u extends Ur{constructor(t,n,r,i,o,s){super(t,3,n),this.limit=r,this.result=i,this.from=o,this.to=s}hasResult(){return!0}updateFor(t,n){var r;if(!(n&3))return this.map(t.changes);let i=this.result;i.map&&!t.changes.empty&&(i=i.map(i,t.changes));let o=t.changes.mapPos(this.from),s=t.changes.mapPos(this.to,1),a=Wa(t.state);if(a>s||!i||n&2&&(Wa(t.startState)==this.from||a<this.limit))return new Ur(this.source,n&4?1:0);let l=t.changes.mapPos(this.limit);return yLe(i.validFor,t.state,o,s)?new _u(this.source,this.explicit,l,i,o,s):i.update&&(i=i.update(i,o,s,new UW(t.state,a,!1)))?new _u(this.source,this.explicit,l,i,i.from,(r=i.to)!==null&&r!==void 0?r:Wa(t.state)):new Ur(this.source,1,this.explicit)}map(t){return t.empty?this:(this.result.map?this.result.map(this.result,t):this.result)?new _u(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new Ur(this.source,0)}touches(t){return t.changes.touchesRange(this.from,this.to)}}function yLe(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e=="function"?e(i,n,r,t):HW(e,!0).test(i)}const aE=ke.define({map(e,t){return e.map(n=>n.map(t))}}),Wn=kn.define({create(){return Av.start()},update(e,t){return e.update(t)},provide:e=>[VP.from(e,t=>t.tooltip),ie.contentAttributes.from(e,t=>t.attrs)]});function lE(e,t){const n=t.completion.apply||t.completion.label;let r=e.state.field(Wn).active.find(i=>i.source==t.source);return r instanceof _u?(typeof n=="string"?e.dispatch({...rLe(e.state,n,r.from,r.to),annotations:VW.of(t.completion)}):n(e,t.completion,r.from,r.to),!0):!1}const vLe=cLe(Wn,lE);function Tm(e,t="option"){return n=>{let r=n.state.field(Wn,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(Zt).interactionDelay)return!1;let i=1,o;t=="page"&&(o=O9(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:s}=r.open.options,a=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:s-1;return a<0?a=t=="page"?0:s-1:a>=s&&(a=t=="page"?s-1:0),n.dispatch({effects:sE.of(a)}),!0}}const bLe=e=>{let t=e.state.field(Wn,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(Zt).interactionDelay?!1:lE(e,t.open.options[t.open.selected])},j1=e=>e.state.field(Wn,!1)?(e.dispatch({effects:Cv.of(!0)}),!0):!1,xLe=e=>{let t=e.state.field(Wn,!1);return!t||!t.active.some(n=>n.state!=0)?!1:(e.dispatch({effects:Fd.of(null)}),!0)};class wLe{constructor(t,n){this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const SLe=50,kLe=1e3,OLe=Et.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(Wn).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(Wn),n=e.state.facet(Zt);if(!e.selectionSet&&!e.docChanged&&e.startState.field(Wn)==t)return;let r=e.transactions.some(o=>{let s=qW(o,n);return s&8||(o.selection||o.docChanged)&&!(s&3)});for(let o=0;o<this.running.length;o++){let s=this.running[o];if(r||s.context.abortOnDocChange&&e.docChanged||s.updates.length+e.transactions.length>SLe&&Date.now()-s.time>kLe){for(let a of s.context.abortListeners)try{a()}catch(l){Gn(this.view.state,l)}s.context.abortListeners=null,this.running.splice(o--,1)}else s.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(o=>o.effects.some(s=>s.is(Cv)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(o=>o.isPending&&!this.running.some(s=>s.active.source==o.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let o of e.transactions)o.isUserEvent("input.type")?this.composing=2:this.composing==2&&o.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(Wn);for(let n of t.active)n.isPending&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Zt).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=Wa(t),r=new UW(t,n,e.explicit,this.view),i=new wLe(e,r);this.running.push(i),Promise.resolve(e.source(r)).then(o=>{i.context.aborted||(i.done=o||null,this.scheduleAccept())},o=>{this.view.dispatch({effects:Fd.of(null)}),Gn(this.view.state,o)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Zt).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(Zt),r=this.view.state.field(Wn);for(let i=0;i<this.running.length;i++){let o=this.running[i];if(o.done===void 0)continue;if(this.running.splice(i--,1),o.done){let a=Wa(o.updates.length?o.updates[0].startState:this.view.state),l=Math.min(a,o.done.from+(o.active.explicit?0:1)),u=new _u(o.active.source,o.active.explicit,l,o.done,o.done.from,(e=o.done.to)!==null&&e!==void 0?e:a);for(let c of o.updates)u=u.update(c,n);if(u.hasResult()){t.push(u);continue}}let s=r.active.find(a=>a.source==o.active.source);if(s&&s.isPending)if(o.done==null){let a=new Ur(o.active.source,0);for(let l of o.updates)a=a.update(l,n);a.isPending||t.push(a)}else this.startQuery(s)}(t.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:aE.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(Wn,!1);if(t&&t.tooltip&&this.view.state.facet(Zt).closeOnBlur){let n=t.open&&O9(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Fd.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Cv.of(!1)}),20),this.composing=0}}}),CLe=typeof navigator=="object"&&/Win/.test(navigator.platform),ALe=bl.highest(ie.domEventHandlers({keydown(e,t){let n=t.state.field(Wn,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(CLe&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(s=>s.source==r.source),o=r.completion.commitCharacters||i.result.commitCharacters;return o&&o.indexOf(e.key)>-1&&lE(t,r),!1}})),PLe=ie.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),zd={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Ea=ke.define({map(e,t){let n=t.mapPos(e,-1,jn.TrackAfter);return n??void 0}}),uE=new class extends js{};uE.startSide=1;uE.endSide=-1;const KW=kn.define({create(){return _e.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of t.effects)n.is(Ea)&&(e=e.update({add:[uE.range(n.value,n.value+1)]}));return e}});function ELe(){return[_Le,KW]}const M1="()[]{}<>«»»«[]{}";function GW(e){for(let t=0;t<M1.length;t+=2)if(M1.charCodeAt(t)==e)return M1.charAt(t+1);return EP(e<128?e:e+1)}function QW(e,t){return e.languageDataAt("closeBrackets",t)[0]||zd}const TLe=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),_Le=ie.inputHandler.of((e,t,n,r)=>{if((TLe?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||r.length==2&&Ni(zn(r,0))==1||t!=i.from||n!=i.to)return!1;let o=ILe(e.state,r);return o?(e.dispatch(o),!0):!1}),jLe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=QW(e,e.selection.main.head).brackets||zd.brackets,i=null,o=e.changeByRange(s=>{if(s.empty){let a=NLe(e.doc,s.head);for(let l of r)if(l==a&&xb(e.doc,s.head)==GW(zn(l,0)))return{changes:{from:s.head-l.length,to:s.head+l.length},range:V.cursor(s.head-l.length)}}return{range:i=s}});return i||t(e.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},MLe=[{key:"Backspace",run:jLe}];function ILe(e,t){let n=QW(e,e.selection.main.head),r=n.brackets||zd.brackets;for(let i of r){let o=GW(zn(i,0));if(t==i)return o==i?LLe(e,i,r.indexOf(i+i+i)>-1,n):RLe(e,i,o,n.before||zd.before);if(t==o&&XW(e,e.selection.main.from))return DLe(e,i,o)}return null}function XW(e,t){let n=!1;return e.field(KW).between(0,e.doc.length,r=>{r==t&&(n=!0)}),n}function xb(e,t){let n=e.sliceString(t,t+2);return n.slice(0,Ni(zn(n,0)))}function NLe(e,t){let n=e.sliceString(t-2,t);return Ni(zn(n,0))==n.length?n:n.slice(1)}function RLe(e,t,n,r){let i=null,o=e.changeByRange(s=>{if(!s.empty)return{changes:[{insert:t,from:s.from},{insert:n,from:s.to}],effects:Ea.of(s.to+t.length),range:V.range(s.anchor+t.length,s.head+t.length)};let a=xb(e.doc,s.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:t+n,from:s.head},effects:Ea.of(s.head+t.length),range:V.cursor(s.head+t.length)}:{range:i=s}});return i?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function DLe(e,t,n){let r=null,i=e.changeByRange(o=>o.empty&&xb(e.doc,o.head)==n?{changes:{from:o.head,to:o.head+n.length,insert:n},range:V.cursor(o.head+n.length)}:r={range:o});return r?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function LLe(e,t,n,r){let i=r.stringPrefixes||zd.stringPrefixes,o=null,s=e.changeByRange(a=>{if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:t,from:a.to}],effects:Ea.of(a.to+t.length),range:V.range(a.anchor+t.length,a.head+t.length)};let l=a.head,u=xb(e.doc,l),c;if(u==t){if(fD(e,l))return{changes:{insert:t+t,from:l},effects:Ea.of(l+t.length),range:V.cursor(l+t.length)};if(XW(e,l)){let h=n&&e.sliceDoc(l,l+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:l,to:l+h.length,insert:h},range:V.cursor(l+h.length)}}}else{if(n&&e.sliceDoc(l-2*t.length,l)==t+t&&(c=hD(e,l-2*t.length,i))>-1&&fD(e,c))return{changes:{insert:t+t+t+t,from:l},effects:Ea.of(l+t.length),range:V.cursor(l+t.length)};if(e.charCategorizer(l)(u)!=yt.Word&&hD(e,l,i)>-1&&!$Le(e,l,t,i))return{changes:{insert:t+t,from:l},effects:Ea.of(l+t.length),range:V.cursor(l+t.length)}}return{range:o=a}});return o?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function fD(e,t){let n=xn(e).resolveInner(t+1);return n.parent&&n.from==t}function $Le(e,t,n,r){let i=xn(e).resolveInner(t,-1),o=r.reduce((s,a)=>Math.max(s,a.length),0);for(let s=0;s<5;s++){let a=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+o)),l=a.indexOf(n);if(!l||l>-1&&r.indexOf(a.slice(0,l))>-1){let c=i.firstChild;for(;c&&c.from==i.from&&c.to-c.from>n.length+l;){if(e.sliceDoc(c.to-n.length,c.to)==n)return!1;c=c.firstChild}return!0}let u=i.to==t&&i.parent;if(!u)break;i=u}return!1}function hD(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=yt.Word)return t;for(let i of n){let o=t-i.length;if(e.sliceDoc(o,t)==i&&r(e.sliceDoc(o-1,o))!=yt.Word)return o}return-1}function BLe(e={}){return[ALe,Wn,Zt.of(e),OLe,FLe,PLe]}const YW=[{key:"Ctrl-Space",run:j1},{mac:"Alt-`",run:j1},{mac:"Alt-i",run:j1},{key:"Escape",run:xLe},{key:"ArrowDown",run:Tm(!0)},{key:"ArrowUp",run:Tm(!1)},{key:"PageDown",run:Tm(!0,"page")},{key:"PageUp",run:Tm(!1,"page")},{key:"Enter",run:bLe}],FLe=bl.highest(fb.computeN([Zt],e=>e.facet(Zt).defaultKeymap?[YW]:[]));class dD{constructor(t,n,r){this.from=t,this.to=n,this.diagnostic=r}}class ma{constructor(t,n,r){this.diagnostics=t,this.panel=n,this.selected=r}static init(t,n,r){let i=r.facet(Wd).markerFilter;i&&(t=i(t,r));let o=t.slice().sort((d,p)=>d.from-p.from||d.to-p.to),s=new Io,a=[],l=0,u=r.doc.iter(),c=0,f=r.doc.length;for(let d=0;;){let p=d==o.length?null:o[d];if(!p&&!a.length)break;let m,v;if(a.length)m=l,v=a.reduce((x,k)=>Math.min(x,k.to),p&&p.from>m?p.from:1e8);else{if(m=p.from,m>f)break;v=p.to,a.push(p),d++}for(;d<o.length;){let x=o[d];if(x.from==m&&(x.to>x.from||x.to==m))a.push(x),d++,v=Math.min(x.to,v);else{v=Math.min(x.from,v);break}}v=Math.min(v,f);let b=!1;if(a.some(x=>x.from==m&&(x.to==v||v==f))&&(b=m==v,!b&&v-m<10)){let x=m-(c+u.value.length);x>0&&(u.next(x),c=m);for(let k=m;;){if(k>=v){b=!0;break}if(!u.lineBreak&&c+u.value.length>k)break;k=c+u.value.length,c+=u.value.length,u.next()}}let y=JLe(a);if(b)s.add(m,m,de.widget({widget:new QLe(y),diagnostics:a.slice()}));else{let x=a.reduce((k,w)=>w.markClass?k+" "+w.markClass:k,"");s.add(m,v,de.mark({class:"cm-lintRange cm-lintRange-"+y+x,diagnostics:a.slice(),inclusiveEnd:a.some(k=>k.to>v)}))}if(l=v,l==f)break;for(let x=0;x<a.length;x++)a[x].to<=l&&a.splice(x--,1)}let h=s.finish();return new ma(h,n,Ls(h))}}function Ls(e,t=null,n=0){let r=null;return e.between(n,1e9,(i,o,{spec:s})=>{if(!(t&&s.diagnostics.indexOf(t)<0))if(!r)r=new dD(i,o,t||s.diagnostics[0]);else{if(s.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new dD(r.from,o,r.diagnostic)}}),r}function zLe(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(Wd).hideOn(e,n,r);if(i!=null)return i;let o=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(s=>s.is(ZW))||e.changes.touchesRange(o.from,Math.max(o.to,r)))}function WLe(e,t){return e.field(wr,!1)?t:t.concat(ke.appendConfig.of(e$e))}const ZW=ke.define(),cE=ke.define(),JW=ke.define(),wr=kn.define({create(){return new ma(de.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let o=t.changes.mapPos(e.selected.from,1);r=Ls(n,e.selected.diagnostic,o)||Ls(n,null,o)}!n.size&&i&&t.state.facet(Wd).autoPanel&&(i=null),e=new ma(n,i,r)}for(let n of t.effects)if(n.is(ZW)){let r=t.state.facet(Wd).autoPanel?n.value.length?Ud.open:null:e.panel;e=ma.init(n.value,r,t.state)}else n.is(cE)?e=new ma(e.diagnostics,n.value?Ud.open:null,e.selected):n.is(JW)&&(e=new ma(e.diagnostics,e.panel,n.value));return e},provide:e=>[Rd.from(e,t=>t.panel),ie.decorations.from(e,t=>t.diagnostics)]}),ULe=de.mark({class:"cm-lintRange cm-lintRange-active"});function HLe(e,t,n){let{diagnostics:r}=e.state.field(wr),i,o=-1,s=-1;r.between(t-(n<0?1:0),t+(n>0?1:0),(l,u,{spec:c})=>{if(t>=l&&t<=u&&(l==u||(t>l||n>0)&&(t<u||n<0)))return i=c.diagnostics,o=l,s=u,!1});let a=e.state.facet(Wd).tooltipFilter;return i&&a&&(i=a(i,e.state)),i?{pos:o,end:s,above:e.state.doc.lineAt(o).to<s,create(){return{dom:VLe(e,i)}}}:null}function VLe(e,t){return Ke("ul",{class:"cm-tooltip-lint"},t.map(n=>tU(e,n,!1)))}const qLe=e=>{let t=e.state.field(wr,!1);(!t||!t.panel)&&e.dispatch({effects:WLe(e.state,[cE.of(!0)])});let n=qP(e,Ud.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},pD=e=>{let t=e.state.field(wr,!1);return!t||!t.panel?!1:(e.dispatch({effects:cE.of(!1)}),!0)},KLe=e=>{let t=e.state.field(wr,!1);if(!t)return!1;let n=e.state.selection.main,r=Ls(t.diagnostics,null,n.to+1);return!r&&(r=Ls(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},GLe=[{key:"Mod-Shift-m",run:qLe,preventDefault:!0},{key:"F8",run:KLe}],Wd=se.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...Ji(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:mD,tooltipFilter:mD,needsRefresh:(t,n)=>t?n?r=>t(r)||n(r):t:n,hideOn:(t,n)=>t?n?(r,i,o)=>t(r,i,o)||n(r,i,o):t:n,autoPanel:(t,n)=>t||n})}}});function mD(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function eU(e){let t=[];if(e)e:for(let{name:n}of e){for(let r=0;r<n.length;r++){let i=n[r];if(/[a-zA-Z]/.test(i)&&!t.some(o=>o.toLowerCase()==i.toLowerCase())){t.push(i);continue e}}t.push("")}return t}function tU(e,t,n){var r;let i=n?eU(t.actions):[];return Ke("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Ke("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(r=t.actions)===null||r===void 0?void 0:r.map((o,s)=>{let a=!1,l=d=>{if(d.preventDefault(),a)return;a=!0;let p=Ls(e.state.field(wr).diagnostics,t);p&&o.apply(e,p.from,p.to)},{name:u}=o,c=i[s]?u.indexOf(i[s]):-1,f=c<0?u:[u.slice(0,c),Ke("u",u.slice(c,c+1)),u.slice(c+1)],h=o.markClass?" "+o.markClass:"";return Ke("button",{type:"button",class:"cm-diagnosticAction"+h,onclick:l,onmousedown:l,"aria-label":` Action: ${u}${c<0?"":` (access key "${i[s]})"`}.`},f)}),t.source&&Ke("div",{class:"cm-diagnosticSource"},t.source))}class QLe extends eo{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return Ke("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class gD{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=tU(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Ud{constructor(t){this.view=t,this.items=[];let n=i=>{if(!(i.ctrlKey||i.altKey||i.metaKey)){if(i.keyCode==27)pD(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:o}=this.items[this.selectedIndex],s=eU(o.actions);for(let a=0;a<s.length;a++)if(s[a].toUpperCase().charCodeAt(0)==i.keyCode){let l=Ls(this.view.state.field(wr).diagnostics,o);l&&o.actions[a].apply(t,l.from,l.to)}}else return;i.preventDefault()}},r=i=>{for(let o=0;o<this.items.length;o++)this.items[o].dom.contains(i.target)&&this.moveSelection(o)};this.list=Ke("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:r}),this.dom=Ke("div",{class:"cm-panel-lint"},this.list,Ke("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>pD(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(wr).selected;if(!t)return-1;for(let n=0;n<this.items.length;n++)if(this.items[n].diagnostic==t.diagnostic)return n;return-1}update(){let{diagnostics:t,selected:n}=this.view.state.field(wr),r=0,i=!1,o=null,s=new Set;for(t.between(0,this.view.state.doc.length,(a,l,{spec:u})=>{for(let c of u.diagnostics){if(s.has(c))continue;s.add(c);let f=-1,h;for(let d=r;d<this.items.length;d++)if(this.items[d].diagnostic==c){f=d;break}f<0?(h=new gD(this.view,c),this.items.splice(r,0,h),i=!0):(h=this.items[f],f>r&&(this.items.splice(r,f-r),i=!0)),n&&h.diagnostic==n.diagnostic?h.dom.hasAttribute("aria-selected")||(h.dom.setAttribute("aria-selected","true"),o=h):h.dom.hasAttribute("aria-selected")&&h.dom.removeAttribute("aria-selected"),r++}});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();this.items.length==0&&(this.items.push(new gD(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),o?(this.list.setAttribute("aria-activedescendant",o.id),this.view.requestMeasure({key:this,read:()=>({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:a,panel:l})=>{let u=l.height/this.list.offsetHeight;a.top<l.top?this.list.scrollTop-=(l.top-a.top)/u:a.bottom>l.bottom&&(this.list.scrollTop+=(a.bottom-l.bottom)/u)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let t=this.list.firstChild;function n(){let r=t;t=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;t!=r.dom;)n();t=r.dom.nextSibling}else this.list.insertBefore(r.dom,t);for(;t;)n()}moveSelection(t){if(this.selectedIndex<0)return;let n=this.view.state.field(wr),r=Ls(n.diagnostics,this.items[t].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:JW.of(r)})}static open(t){return new Ud(t)}}function XLe(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function _m(e){return XLe(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const YLe=ie.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:_m("#d11")},".cm-lintRange-warning":{backgroundImage:_m("orange")},".cm-lintRange-info":{backgroundImage:_m("#999")},".cm-lintRange-hint":{backgroundImage:_m("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function ZLe(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function JLe(e){let t="hint",n=1;for(let r of e){let i=ZLe(r.severity);i>n&&(n=i,t=r.severity)}return t}const e$e=[wr,ie.decorations.compute([wr],e=>{let{selected:t,panel:n}=e.field(wr);return!t||!n||t.from==t.to?de.none:de.set([ULe.range(t.from,t.to)])}),HIe(HLe,{hideOn:zLe}),YLe];var yD=function(t){t===void 0&&(t={});var{crosshairCursor:n=!1}=t,r=[];t.closeBracketsKeymap!==!1&&(r=r.concat(MLe)),t.defaultKeymap!==!1&&(r=r.concat(ODe)),t.searchKeymap!==!1&&(r=r.concat(YDe)),t.historyKeymap!==!1&&(r=r.concat(jRe)),t.foldKeymap!==!1&&(r=r.concat(VNe)),t.completionKeymap!==!1&&(r=r.concat(YW)),t.lintKeymap!==!1&&(r=r.concat(GLe));var i=[];return t.lineNumbers!==!1&&i.push(rNe()),t.highlightActiveLineGutter!==!1&&i.push(sNe()),t.highlightSpecialChars!==!1&&i.push(bIe()),t.history!==!1&&i.push(SRe()),t.foldGutter!==!1&&i.push(QNe()),t.drawSelection!==!1&&i.push(lIe()),t.dropCursor!==!1&&i.push(dIe()),t.allowMultipleSelections!==!1&&i.push(Ne.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&i.push(RNe()),t.syntaxHighlighting!==!1&&i.push(Y9(JNe,{fallback:!0})),t.bracketMatching!==!1&&i.push(sRe()),t.closeBrackets!==!1&&i.push(ELe()),t.autocompletion!==!1&&i.push(BLe()),t.rectangularSelection!==!1&&i.push(IIe()),n!==!1&&i.push(DIe()),t.highlightActiveLine!==!1&&i.push(CIe()),t.highlightSelectionMatches!==!1&&i.push(_De()),t.tabSize&&typeof t.tabSize=="number"&&i.push(db.of(" ".repeat(t.tabSize))),i.concat([fb.of(r.flat())]).filter(Boolean)};const t$e="#e5c07b",vD="#e06c75",n$e="#56b6c2",r$e="#ffffff",ag="#abb2bf",NO="#7d8799",i$e="#61afef",o$e="#98c379",bD="#d19a66",s$e="#c678dd",a$e="#21252b",xD="#2c313a",wD="#282c34",I1="#353a42",l$e="#3E4451",SD="#528bff",u$e=ie.theme({"&":{color:ag,backgroundColor:wD},".cm-content":{caretColor:SD},".cm-cursor, .cm-dropCursor":{borderLeftColor:SD},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:l$e},".cm-panels":{backgroundColor:a$e,color:ag},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:wD,color:NO,border:"none"},".cm-activeLineGutter":{backgroundColor:xD},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:I1},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:I1,borderBottomColor:I1},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:xD,color:ag}}},{dark:!0}),c$e=dp.define([{tag:W.keyword,color:s$e},{tag:[W.name,W.deleted,W.character,W.propertyName,W.macroName],color:vD},{tag:[W.function(W.variableName),W.labelName],color:i$e},{tag:[W.color,W.constant(W.name),W.standard(W.name)],color:bD},{tag:[W.definition(W.name),W.separator],color:ag},{tag:[W.typeName,W.className,W.number,W.changed,W.annotation,W.modifier,W.self,W.namespace],color:t$e},{tag:[W.operator,W.operatorKeyword,W.url,W.escape,W.regexp,W.link,W.special(W.string)],color:n$e},{tag:[W.meta,W.comment],color:NO},{tag:W.strong,fontWeight:"bold"},{tag:W.emphasis,fontStyle:"italic"},{tag:W.strikethrough,textDecoration:"line-through"},{tag:W.link,color:NO,textDecoration:"underline"},{tag:W.heading,fontWeight:"bold",color:vD},{tag:[W.atom,W.bool,W.special(W.variableName)],color:bD},{tag:[W.processingInstruction,W.string,W.inserted],color:o$e},{tag:W.invalid,color:r$e}]),f$e=[u$e,Y9(c$e)];var h$e=ie.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),d$e=function(t){t===void 0&&(t={});var{indentWithTab:n=!0,editable:r=!0,readOnly:i=!1,theme:o="light",placeholder:s="",basicSetup:a=!0}=t,l=[];switch(n&&l.unshift(fb.of([CDe])),a&&(typeof a=="boolean"?l.unshift(yD()):l.unshift(yD(a))),s&&l.unshift(TIe(s)),o){case"light":l.push(h$e);break;case"dark":l.push(f$e);break;case"none":break;default:l.push(o);break}return r===!1&&l.push(ie.editable.of(!1)),i&&l.push(Ne.readOnly.of(!0)),[...l]},p$e=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(t=>!t.empty)});class m$e{constructor(t,n){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=n,this.timeoutMS=n,this.callbacks.push(t)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var t=this.callbacks.slice();this.callbacks.length=0,t.forEach(n=>{try{n()}catch(r){console.error("TimeoutLatch callback error:",r)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class kD{constructor(){this.interval=null,this.latches=new Set}add(t){this.latches.add(t),this.start()}remove(t){this.latches.delete(t),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(t=>{t.tick(),t.isDone&&this.remove(t)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var N1=null,g$e=()=>typeof window>"u"?new kD:(N1||(N1=new kD),N1),OD=Zi.define(),y$e=200,v$e=[];function b$e(e){var{value:t,selection:n,onChange:r,onStatistics:i,onCreateEditor:o,onUpdate:s,extensions:a=v$e,autoFocus:l,theme:u="light",height:c=null,minHeight:f=null,maxHeight:h=null,width:d=null,minWidth:p=null,maxWidth:m=null,placeholder:v="",editable:b=!0,readOnly:y=!1,indentWithTab:x=!0,basicSetup:k=!0,root:w,initialState:S}=e,[O,A]=C.useState(),[P,M]=C.useState(),[j,E]=C.useState(),D=C.useState(()=>({current:null}))[0],R=C.useState(()=>({current:null}))[0],N=ie.theme({"&":{height:c,minHeight:f,maxHeight:h,width:d,minWidth:p,maxWidth:m},"& .cm-scroller":{height:"100% !important"}}),B=ie.updateListener.of(z=>{if(z.docChanged&&typeof r=="function"&&!z.transactions.some(I=>I.annotation(OD))){D.current?D.current.reset():(D.current=new m$e(()=>{if(R.current){var I=R.current;R.current=null,I()}D.current=null},y$e),g$e().add(D.current));var T=z.state.doc,q=T.toString();r(q,z)}i&&i(p$e(z))}),F=d$e({theme:u,editable:b,readOnly:y,placeholder:v,indentWithTab:x,basicSetup:k}),$=[B,N,...F];return s&&typeof s=="function"&&$.push(ie.updateListener.of(s)),$=$.concat(a),C.useLayoutEffect(()=>{if(O&&!j){var z={doc:t,selection:n,extensions:$},T=S?Ne.fromJSON(S.json,z,S.fields):Ne.create(z);if(E(T),!P){var q=new ie({state:T,parent:O,root:w});M(q),o&&o(q,T)}}return()=>{P&&(E(void 0),M(void 0))}},[O,j]),C.useEffect(()=>{e.container&&A(e.container)},[e.container]),C.useEffect(()=>()=>{P&&(P.destroy(),M(void 0)),D.current&&(D.current.cancel(),D.current=null)},[P]),C.useEffect(()=>{l&&P&&P.focus()},[l,P]),C.useEffect(()=>{P&&P.dispatch({effects:ke.reconfigure.of($)})},[u,a,c,f,h,d,p,m,v,b,y,x,k,r,s]),C.useEffect(()=>{if(t!==void 0){var z=P?P.state.doc.toString():"";if(P&&t!==z){var T=D.current&&!D.current.isDone,q=()=>{P&&t!==P.state.doc.toString()&&P.dispatch({changes:{from:0,to:P.state.doc.toString().length,insert:t||""},annotations:[OD.of(!0)]})};T?R.current=q:q()}}},[t,P]),{state:j,setState:E,view:P,setView:M,container:O,setContainer:A}}var x$e=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],nU=C.forwardRef((e,t)=>{var{className:n,value:r="",selection:i,extensions:o=[],onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:u,autoFocus:c,theme:f="light",height:h,minHeight:d,maxHeight:p,width:m,minWidth:v,maxWidth:b,basicSetup:y,placeholder:x,indentWithTab:k,editable:w,readOnly:S,root:O,initialState:A}=e,P=Dve(e,x$e),M=C.useRef(null),{state:j,view:E,container:D,setContainer:R}=b$e({root:O,value:r,autoFocus:c,theme:f,height:h,minHeight:d,maxHeight:p,width:m,minWidth:v,maxWidth:b,basicSetup:y,placeholder:x,indentWithTab:k,editable:w,readOnly:S,selection:i,onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:u,extensions:o,initialState:A});C.useImperativeHandle(t,()=>({editor:M.current,state:j,view:E}),[M,D,j,E]);var N=C.useCallback(F=>{M.current=F,R(F)},[R]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var B=typeof f=="string"?"cm-theme-"+f:"cm-theme";return g.jsx("div",QS({ref:N,className:""+B+(n?" "+n:"")},P))});nU.displayName="CodeMirror";var CD={};class Pv{constructor(t,n,r,i,o,s,a,l,u,c=0,f){this.p=t,this.stack=n,this.state=r,this.reducePos=i,this.pos=o,this.score=s,this.buffer=a,this.bufferBase=l,this.curContext=u,this.lookAhead=c,this.parent=f}toString(){return`[${this.stack.filter((t,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,n,r=0){let i=t.parser.context;return new Pv(t,[],n,r,r,0,[],0,i?new AD(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var n;let r=t>>19,i=t&65535,{parser:o}=this.p,s=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=o.dynamicPrecedence(i);if(a&&(this.score+=a),r==0){i<o.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(o.getGoto(this.state,i,!0),this.reducePos),i<o.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,s?8:4,!0),this.reduceContext(i,this.reducePos);return}let l=this.stack.length-(r-1)*3-(t&262144?6:0),u=l?this.stack[l-2]:this.p.ranges[0].from;i<o.minRepeatTerm&&u==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let c=this.reducePos-u;c>=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(u==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=u,this.p.lastBigReductionSize=c));let f=l?this.stack[l-1]:0,h=this.bufferBase+this.buffer.length-f;if(i<o.minRepeatTerm||t&131072){let d=o.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,u,d,h+4,!0)}if(t&262144)this.state=this.stack[l];else{let d=this.stack[l-3];this.state=o.getGoto(d,i,!0)}for(;this.stack.length>l;)this.stack.pop();this.reduceContext(i,u)}storeNode(t,n,r,i=4,o=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let s=this.buffer.length;if(s>0&&this.buffer[s-4]==0&&this.buffer[s-1]>-1){if(n==r)return;if(this.buffer[s-2]>=n){this.buffer[s-2]=r;return}}}if(!o||this.pos==r)this.buffer.push(t,n,r,i);else{let s=this.buffer.length;if(s>0&&(this.buffer[s-4]!=0||this.buffer[s-1]<0)){let a=!1;for(let l=s;l>0&&this.buffer[l-2]>r;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;s>0&&this.buffer[s-2]>r;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,i>4&&(i-=4)}this.buffer[s]=t,this.buffer[s+1]=n,this.buffer[s+2]=r,this.buffer[s+3]=i}}shift(t,n,r,i){if(t&131072)this.pushState(t&65535,this.pos);else if(t&262144)this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4);else{let o=t,{parser:s}=this.p;this.pos=i;let a=s.stateFlag(o,1);!a&&(i>r||n<=s.maxNode)&&(this.reducePos=i),this.pushState(o,a?r:Math.min(r,this.reducePos)),this.shiftContext(n,r),n<=s.maxNode&&this.buffer.push(n,r,i,4)}}apply(t,n,r,i){t&65536?this.reduce(t):this.shift(t,n,r,i)}useNode(t,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=t)&&(this.p.reused.push(t),r++);let i=this.pos;this.reducePos=this.pos=i+t.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new Pv(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(t,n){let r=t<=this.p.parser.maxNode;r&&this.storeNode(t,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(t){for(let n=new w$e(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,t);if(r==0)return!1;if(!(r&65536))return!0;n.reduce(r)}}recoverByInsert(t){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let o=0,s;o<n.length;o+=2)(s=n[o+1])!=this.state&&this.p.parser.hasAction(s,t)&&i.push(n[o],s);if(this.stack.length<120)for(let o=0;i.length<8&&o<n.length;o+=2){let s=n[o+1];i.some((a,l)=>l&1&&a==s)||i.push(n[o],s)}n=i}let r=[];for(let i=0;i<n.length&&r.length<4;i+=2){let o=n[i+1];if(o==this.state)continue;let s=this.split();s.pushState(o,this.pos),s.storeNode(0,s.pos,s.pos,4,!0),s.shiftContext(n[i],this.pos),s.reducePos=this.pos,s.score-=200,r.push(s)}return r}forceReduce(){let{parser:t}=this.p,n=t.stateSlot(this.state,5);if(!(n&65536))return!1;if(!t.validAction(this.state,n)){let r=n>>19,i=n&65535,o=this.stack.length-r*3;if(o<0||t.getGoto(this.stack[o],i,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;n=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:t}=this.p,n=[],r=(i,o)=>{if(!n.includes(i))return n.push(i),t.allActions(i,s=>{if(!(s&393216))if(s&65536){let a=(s>>19)-o;if(a>1){let l=s&65535,u=this.stack.length-a*3;if(u>=0&&t.getGoto(this.stack[u],l,!1)>=0)return a<<19|65536|l}}else{let a=r(s,o+1);if(a!=null)return a}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=t.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(t){return this.p.parser.dialect.flags[t]}shiftContext(t,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,t,this,this.p.stream.reset(n)))}reduceContext(t,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,t,this,this.p.stream.reset(n)))}emitContext(){let t=this.buffer.length-1;(t<0||this.buffer[t]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let t=this.buffer.length-1;(t<0||this.buffer[t]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(t){if(t!=this.curContext.context){let n=new AD(this.curContext.tracker,t);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(t){return t<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=t,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class AD{constructor(t,n){this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0}}class w$e{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let n=t&65535,r=t>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class Ev{constructor(t,n,r){this.stack=t,this.pos=n,this.index=r,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new Ev(t,n,n-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Ev(this.stack,this.pos,this.index)}}function jm(e,t=Uint16Array){if(typeof e!="string")return e;let n=null;for(let r=0,i=0;r<e.length;){let o=0;for(;;){let s=e.charCodeAt(r++),a=!1;if(s==126){o=65535;break}s>=92&&s--,s>=34&&s--;let l=s-32;if(l>=46&&(l-=46,a=!0),o+=l,a)break;o*=46}n?n[i++]=o:n=new t(o)}return n}class lg{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const PD=new lg;class S$e{constructor(t,n){this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=PD,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(t,n){let r=this.range,i=this.rangeIndex,o=this.pos+t;for(;o<r.from;){if(!i)return null;let s=this.ranges[--i];o-=r.from-s.to,r=s}for(;n<0?o>r.to:o>=r.to;){if(i==this.ranges.length-1)return null;let s=this.ranges[++i];o+=s.from-r.to,r=s}return o}clipPos(t){if(t>=this.range.from&&t<this.range.to)return t;for(let n of this.ranges)if(n.to>t)return Math.max(t,n.from);return this.end}peek(t){let n=this.chunkOff+t,r,i;if(n>=0&&n<this.chunk.length)r=this.pos+t,i=this.chunk.charCodeAt(n);else{let o=this.resolveOffset(t,1);if(o==null)return-1;if(r=o,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let s=this.rangeIndex,a=this.range;for(;a.to<=r;)a=this.ranges[++s];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>a.to&&(this.chunk2=this.chunk2.slice(0,a.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(t,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=t,this.token.end=r}acceptTokenTo(t,n){this.token.value=t,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:t,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=t,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let t=this.input.chunk(this.pos),n=this.pos+t.length;this.chunk=n>this.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,n){if(n?(this.token=n,n.start=t,n.lookAhead=t+1,n.value=n.extended=-1):this.token=PD,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;t>=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t<this.chunkPos+this.chunk.length?this.chunkOff=t-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(t,n){if(t>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,n-this.chunkPos);if(t>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,n-this.chunk2Pos);if(t>=this.range.from&&n<=this.range.to)return this.input.read(t,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>t&&(r+=this.input.read(Math.max(i.from,t),Math.min(i.to,n)))}return r}}class ju{constructor(t,n){this.data=t,this.id=n}token(t,n){let{parser:r}=n.p;k$e(this.data,t,n,this.id,r.data,r.tokenPrecTable)}}ju.prototype.contextual=ju.prototype.fallback=ju.prototype.extend=!1;ju.prototype.fallback=ju.prototype.extend=!1;class wb{constructor(t,n={}){this.token=t,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function k$e(e,t,n,r,i,o){let s=0,a=1<<r,{dialect:l}=n.p.parser;e:for(;a&e[s];){let u=e[s+1];for(let d=s+3;d<u;d+=2)if((e[d+1]&a)>0){let p=e[d];if(l.allows(p)&&(t.token.value==-1||t.token.value==p||O$e(p,t.token.value,i,o))){t.acceptToken(p);break}}let c=t.next,f=0,h=e[s+2];if(t.next<0&&h>f&&e[u+h*3-3]==65535){s=e[u+h*3-1];continue e}for(;f<h;){let d=f+h>>1,p=u+d+(d<<1),m=e[p],v=e[p+1]||65536;if(c<m)h=d;else if(c>=v)f=d+1;else{s=e[p+2],t.advance();continue e}}break}}function ED(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function O$e(e,t,n,r){let i=ED(n,r,t);return i<0||ED(n,r,e)<i}const ur=typeof process<"u"&&CD&&/\bparse\b/.test(CD.LOG);let R1=null;function TD(e,t,n){let r=e.cursor(At.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}class C$e{constructor(t,n){this.fragments=t,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?TD(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?TD(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(t<this.nextStart)return null;for(;this.fragment&&this.safeTo<=t;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],i=this.index[n];if(i==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let o=r.children[i],s=this.start[n]+r.positions[i];if(s>t)return this.nextStart=s,null;if(o instanceof jt){if(s==t){if(s<this.safeFrom)return null;let a=s+o.length;if(a<=this.safeTo){let l=o.prop(Te.lookAhead);if(!l||a+l<this.fragment.to)return o}}this.index[n]++,s+o.length>=Math.max(this.safeFrom,t)&&(this.trees.push(o),this.start.push(s),this.index.push(0))}else this.index[n]++,this.nextStart=s+o.length}}}class A$e{constructor(t,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(r=>new lg)}getActions(t){let n=0,r=null,{parser:i}=t.p,{tokenizers:o}=i,s=i.stateSlot(t.state,3),a=t.curContext?t.curContext.hash:0,l=0;for(let u=0;u<o.length;u++){if(!(1<<u&s))continue;let c=o[u],f=this.tokens[u];if(!(r&&!c.fallback)&&((c.contextual||f.start!=t.pos||f.mask!=s||f.context!=a)&&(this.updateCachedToken(f,c,t),f.mask=s,f.context=a),f.lookAhead>f.end+25&&(l=Math.max(f.lookAhead,l)),f.value!=0)){let h=n;if(f.extended>-1&&(n=this.addActions(t,f.extended,f.end,n)),n=this.addActions(t,f.value,f.end,n),!c.extend&&(r=f,n>h))break}}for(;this.actions.length>n;)this.actions.pop();return l&&t.setLookAhead(l),!r&&t.pos==this.stream.end&&(r=new lg,r.value=t.p.parser.eofTerm,r.start=r.end=t.pos,n=this.addActions(t,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let n=new lg,{pos:r,p:i}=t;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(t,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,t),r),t.value>-1){let{parser:o}=r.p;for(let s=0;s<o.specialized.length;s++)if(o.specialized[s]==t.value){let a=o.specializers[s](this.stream.read(t.start,t.end),r);if(a>=0&&r.p.parser.dialect.allows(a>>1)){a&1?t.extended=a>>1:t.value=a>>1;break}}}else t.value=0,t.end=this.stream.clipPos(i+1)}putAction(t,n,r,i){for(let o=0;o<i;o+=3)if(this.actions[o]==t)return i;return this.actions[i++]=t,this.actions[i++]=n,this.actions[i++]=r,i}addActions(t,n,r,i){let{state:o}=t,{parser:s}=t.p,{data:a}=s;for(let l=0;l<2;l++)for(let u=s.stateSlot(o,l?2:1);;u+=3){if(a[u]==65535)if(a[u+1]==1)u=uo(a,u+2);else{i==0&&a[u+1]==2&&(i=this.putAction(uo(a,u+2),n,r,i));break}a[u]==n&&(i=this.putAction(uo(a,u+1),n,r,i))}return i}}class P$e{constructor(t,n,r,i){this.parser=t,this.input=n,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new S$e(n,i),this.tokens=new A$e(t,this.stream),this.topTerm=t.top[1];let{from:o}=i[0];this.stacks=[Pv.start(this,t.top[0],o)],this.fragments=r.length&&this.stream.end-o>t.bufferLength*4?new C$e(r,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,n=this.minStackPos,r=this.stacks=[],i,o;if(this.bigReductionCount>300&&t.length==1){let[s]=t;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;s<t.length;s++){let a=t[s];for(;;){if(this.tokens.mainToken=null,a.pos>n)r.push(a);else{if(this.advanceStack(a,r,t))continue;{i||(i=[],o=[]),i.push(a);let l=this.tokens.getMainToken(a);o.push(l.value,l.end)}}break}}if(!r.length){let s=i&&_$e(i);if(s)return ur&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw ur&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,o,r);if(s)return ur&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(r.length>s)for(r.sort((a,l)=>l.score-a.score);r.length>s;)r.pop();r.some(a=>a.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let s=0;s<r.length-1;s++){let a=r[s];for(let l=s+1;l<r.length;l++){let u=r[l];if(a.sameState(u)||a.buffer.length>500&&u.buffer.length>500)if((a.score-u.score||a.buffer.length-u.buffer.length)>0)r.splice(l--,1);else{r.splice(s--,1);continue e}}}r.length>12&&(r.sort((s,a)=>a.score-s.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let s=1;s<r.length;s++)r[s].pos<this.minStackPos&&(this.minStackPos=r[s].pos);return null}stopAt(t){if(this.stoppedAt!=null&&this.stoppedAt<t)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=t}advanceStack(t,n,r){let i=t.pos,{parser:o}=this,s=ur?this.stackID(t)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let u=t.curContext&&t.curContext.tracker.strict,c=u?t.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let h=this.parser.nodeSet.types[f.type.id]==f.type?o.getGoto(t.state,f.type.id):-1;if(h>-1&&f.length&&(!u||(f.prop(Te.contextHash)||0)==c))return t.useNode(f,h),ur&&console.log(s+this.stackID(t)+` (via reuse of ${o.getName(f.type.id)})`),!0;if(!(f instanceof jt)||f.children.length==0||f.positions[0]>0)break;let d=f.children[0];if(d instanceof jt&&f.positions[0]==0)f=d;else break}}let a=o.stateSlot(t.state,4);if(a>0)return t.reduce(a),ur&&console.log(s+this.stackID(t)+` (via always-reduce ${o.getName(a&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let l=this.tokens.getActions(t);for(let u=0;u<l.length;){let c=l[u++],f=l[u++],h=l[u++],d=u==l.length||!r,p=d?t:t.split(),m=this.tokens.mainToken;if(p.apply(c,f,m?m.start:p.pos,h),ur&&console.log(s+this.stackID(p)+` (via ${c&65536?`reduce of ${o.getName(c&65535)}`:"shift"} for ${o.getName(f)} @ ${i}${p==t?"":", split"})`),d)return!0;p.pos>i?n.push(p):r.push(p)}return!1}advanceFully(t,n){let r=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>r)return _D(t,n),!0}}runRecovery(t,n,r){let i=null,o=!1;for(let s=0;s<t.length;s++){let a=t[s],l=n[s<<1],u=n[(s<<1)+1],c=ur?this.stackID(a)+" -> ":"";if(a.deadEnd&&(o||(o=!0,a.restart(),ur&&console.log(c+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let f=a.split(),h=c;for(let d=0;d<10&&f.forceReduce()&&(ur&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));d++)ur&&(h=this.stackID(f)+" -> ");for(let d of a.recoverByInsert(l))ur&&console.log(c+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,r);this.stream.end>a.pos?(u==a.pos&&(u++,l=0),a.recoverByDelete(l,u),ur&&console.log(c+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),_D(a,r)):(!i||i.score<f.score)&&(i=f)}return i}stackToTree(t){return t.close(),jt.build({buffer:Ev.create(t),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:t.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(t){let n=(R1||(R1=new WeakMap)).get(t);return n||R1.set(t,n=String.fromCodePoint(this.nextStackID++)),n+t}}function _D(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}class E$e{constructor(t,n,r){this.source=t,this.flags=n,this.disabled=r}allows(t){return!this.disabled||this.disabled[t]==0}}const D1=e=>e;class T$e{constructor(t){this.start=t.start,this.shift=t.shift||D1,this.reduce=t.reduce||D1,this.reuse=t.reuse||D1,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class Tv extends N9{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let n=t.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let a=0;a<t.repeatNodeCount;a++)n.push("");let r=Object.keys(t.topRules).map(a=>t.topRules[a][1]),i=[];for(let a=0;a<n.length;a++)i.push([]);function o(a,l,u){i[a].push([l,l.deserialize(String(u))])}if(t.nodeProps)for(let a of t.nodeProps){let l=a[0];typeof l=="string"&&(l=Te[l]);for(let u=1;u<a.length;){let c=a[u++];if(c>=0)o(c,l,a[u++]);else{let f=a[u+-c];for(let h=-c;h>0;h--)o(a[u++],l,f);u++}}}this.nodeSet=new KP(n.map((a,l)=>nr.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:i[l],top:r.indexOf(l)>-1,error:l==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(l)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=_9;let s=jm(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;a<this.specializerSpecs.length;a++)this.specialized[a]=this.specializerSpecs[a].term;this.specializers=this.specializerSpecs.map(jD),this.states=jm(t.states,Uint32Array),this.data=jm(t.stateData),this.goto=jm(t.goto),this.maxTerm=t.maxTerm,this.tokenizers=t.tokenizers.map(a=>typeof a=="number"?new ju(s,a):a),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,n,r){let i=new P$e(this,t,n,r);for(let o of this.wrappers)i=o(i,t,n,r);return i}getGoto(t,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let o=i[n+1];;){let s=i[o++],a=s&1,l=i[o++];if(a&&r)return l;for(let u=o+(s>>1);o<u;o++)if(i[o]==t)return l;if(a)return-1}}hasAction(t,n){let r=this.data;for(let i=0;i<2;i++)for(let o=this.stateSlot(t,i?2:1),s;;o+=3){if((s=r[o])==65535)if(r[o+1]==1)s=r[o=uo(r,o+2)];else{if(r[o+1]==2)return uo(r,o+2);break}if(s==n||s==0)return uo(r,o+1)}return 0}stateSlot(t,n){return this.states[t*6+n]}stateFlag(t,n){return(this.stateSlot(t,0)&n)>0}validAction(t,n){return!!this.allActions(t,r=>r==n?!0:null)}allActions(t,n){let r=this.stateSlot(t,4),i=r?n(r):void 0;for(let o=this.stateSlot(t,1);i==null;o+=3){if(this.data[o]==65535)if(this.data[o+1]==1)o=uo(this.data,o+2);else break;i=n(uo(this.data,o+1))}return i}nextStates(t){let n=[];for(let r=this.stateSlot(t,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=uo(this.data,r+2);else break;if(!(this.data[r+2]&1)){let i=this.data[r+1];n.some((o,s)=>s&1&&o==i)||n.push(this.data[r],i)}}return n}configure(t){let n=Object.assign(Object.create(Tv.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let r=this.topRules[t.top];if(!r)throw new RangeError(`Invalid top rule name ${t.top}`);n.top=r}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=t.tokenizers.find(o=>o.from==r);return i?i.to:r})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let o=t.specializers.find(a=>a.from==r.external);if(!o)return r;let s=Object.assign(Object.assign({},r),{external:o.to});return n.specializers[i]=jD(s),s})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let n=this.dynamicPrecedences;return n==null?0:n[t]||0}parseDialect(t){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(t)for(let o of t.split(" ")){let s=n.indexOf(o);s>=0&&(r[s]=!0)}let i=null;for(let o=0;o<n.length;o++)if(!r[o])for(let s=this.dialects[n[o]],a;(a=this.data[s++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[a]=1;return new E$e(t,r,i)}static deserialize(t){return new Tv(t)}}function uo(e,t){return e[t]|e[t+1]<<16}function _$e(e){let t=null;for(let n of e){let r=n.p.stoppedAt;(n.pos==n.p.stream.end||r!=null&&n.pos>r)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function jD(e){if(e.external){let t=e.extend?1:0;return(n,r)=>e.external(n,r)<<1|t}return e.get}const zl=63,MD=64,j$e=1,M$e=2,rU=3,I$e=4,iU=5,N$e=6,R$e=7,oU=65,D$e=66,L$e=8,$$e=9,B$e=10,F$e=11,z$e=12,sU=13,W$e=19,U$e=20,H$e=29,V$e=33,q$e=34,K$e=47,G$e=0,fE=1,RO=2,Hd=3,DO=4;class ga{constructor(t,n,r){this.parent=t,this.depth=n,this.type=r,this.hash=(t?t.hash+t.hash<<8:0)+n+(n<<4)+r}}ga.top=new ga(null,-1,G$e);function mh(e,t){for(let n=0,r=t-e.pos-1;;r--,n++){let i=e.peek(r);if(Do(i)||i==-1)return n}}function LO(e){return e==32||e==9}function Do(e){return e==10||e==13}function aU(e){return LO(e)||Do(e)}function Ta(e){return e<0||aU(e)}const Q$e=new T$e({start:ga.top,reduce(e,t){return e.type==Hd&&(t==U$e||t==q$e)?e.parent:e},shift(e,t,n,r){if(t==rU)return new ga(e,mh(r,r.pos),fE);if(t==oU||t==iU)return new ga(e,mh(r,r.pos),RO);if(t==zl)return e.parent;if(t==W$e||t==V$e)return new ga(e,0,Hd);if(t==sU&&e.type==DO)return e.parent;if(t==K$e){let i=/[1-9]/.exec(r.read(r.pos,n.pos));if(i)return new ga(e,e.depth+ +i[0],DO)}return e},hash(e){return e.hash}});function Sc(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&Ta(e.peek(n+3))}const X$e=new wb((e,t)=>{if(e.next==-1&&t.canShift(MD))return e.acceptToken(MD);let n=e.peek(-1);if((Do(n)||n<0)&&t.context.type!=Hd){if(Sc(e,45))if(t.canShift(zl))e.acceptToken(zl);else return e.acceptToken(j$e,3);if(Sc(e,46))if(t.canShift(zl))e.acceptToken(zl);else return e.acceptToken(M$e,3);let r=0;for(;e.next==32;)r++,e.advance();(r<t.context.depth||r==t.context.depth&&t.context.type==fE&&(e.next!=45||!Ta(e.peek(1))))&&e.next!=-1&&!Do(e.next)&&e.next!=35&&e.acceptToken(zl,-r)}},{contextual:!0}),Y$e=new wb((e,t)=>{if(t.context.type==Hd){e.next==63&&(e.advance(),Ta(e.next)&&e.acceptToken(R$e));return}if(e.next==45)e.advance(),Ta(e.next)&&e.acceptToken(t.context.type==fE&&t.context.depth==mh(e,e.pos-1)?I$e:rU);else if(e.next==63)e.advance(),Ta(e.next)&&e.acceptToken(t.context.type==RO&&t.context.depth==mh(e,e.pos-1)?N$e:iU);else{let n=e.pos;for(;;)if(LO(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)lU(e);else if(e.next==38)$O(e);else if(e.next==42){$O(e);break}else if(e.next==39||e.next==34){if(hE(e,!0))break;return}else if(e.next==91||e.next==123){if(!J$e(e))return;break}else{uU(e,!0,!1,0);break}for(;LO(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(H$e))return;let r=e.peek(1);Ta(r)&&e.acceptTokenTo(t.context.type==RO&&t.context.depth==mh(e,n)?D$e:oU,n)}}},{contextual:!0});function Z$e(e){return e>32&&e<127&&e!=34&&e!=37&&e!=44&&e!=60&&e!=62&&e!=92&&e!=94&&e!=96&&e!=123&&e!=124&&e!=125}function ID(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function ND(e,t){return e.next==37?(e.advance(),ID(e.next)&&e.advance(),ID(e.next)&&e.advance(),!0):Z$e(e.next)||t&&e.next==44?(e.advance(),!0):!1}function lU(e){if(e.advance(),e.next==60){for(e.advance();;)if(!ND(e,!0)){e.next==62&&e.advance();break}}else for(;ND(e,!1););}function $O(e){for(e.advance();!Ta(e.next)&&_v(e.next)!="f";)e.advance()}function hE(e,t){let n=e.next,r=!1,i=e.pos;for(e.advance();;){let o=e.next;if(o<0)break;if(e.advance(),o==n)if(o==39)if(e.next==39)e.advance();else break;else break;else if(o==92&&n==34)e.next>=0&&e.advance();else if(Do(o)){if(t)return!1;r=!0}else if(t&&e.pos>=i+1024)return!1}return!r}function J$e(e){for(let t=[],n=e.pos+1024;;)if(e.next==91||e.next==123)t.push(e.next),e.advance();else if(e.next==39||e.next==34){if(!hE(e,!0))return!1}else if(e.next==93||e.next==125){if(t[t.length-1]!=e.next-2)return!1;if(t.pop(),e.advance(),!t.length)return!0}else{if(e.next<0||e.pos>n||Do(e.next))return!1;e.advance()}}const eBe="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function _v(e){return e<33?"u":e>125?"s":eBe[e-33]}function L1(e,t){let n=_v(e);return n!="u"&&!(t&&n=="f")}function uU(e,t,n,r){if(_v(e.next)=="s"||(e.next==63||e.next==58||e.next==45)&&L1(e.peek(1),n))e.advance();else return!1;let i=e.pos;for(;;){let o=e.next,s=0,a=r+1;for(;aU(o);){if(Do(o)){if(t)return!1;a=0}else a++;o=e.peek(++s)}if(!(o>=0&&(o==58?L1(e.peek(s+1),n):o==35?e.peek(s-1)!=32:L1(o,n)))||!n&&a<=r||a==0&&!n&&(Sc(e,45,s)||Sc(e,46,s)))break;if(t&&_v(o)=="f")return!1;for(let u=s;u>=0;u--)e.advance();if(t&&e.pos>i+1024)return!1}return!0}const tBe=new wb((e,t)=>{if(e.next==33)lU(e),e.acceptToken(z$e);else if(e.next==38||e.next==42){let n=e.next==38?B$e:F$e;$O(e),e.acceptToken(n)}else e.next==39||e.next==34?(hE(e,!1),e.acceptToken($$e)):uU(e,!1,t.context.type==Hd,t.context.depth)&&e.acceptToken(L$e)}),nBe=new wb((e,t)=>{let n=t.context.type==DO?t.context.depth:-1,r=e.pos;e:for(;;){let i=0,o=e.next;for(;o==32;)o=e.peek(++i);if(!i&&(Sc(e,45,i)||Sc(e,46,i))||!Do(o)&&(n<0&&(n=Math.max(t.context.depth+1,i)),i<n))break;for(;;){if(e.next<0)break e;let s=Do(e.next);if(e.advance(),s)continue e;r=e.pos}}e.acceptTokenTo(sU,r)}),rBe=R9({DirectiveName:W.keyword,DirectiveContent:W.attributeValue,"DirectiveEnd DocEnd":W.meta,QuotedLiteral:W.string,BlockLiteralHeader:W.special(W.string),BlockLiteralContent:W.content,Literal:W.content,"Key/Literal Key/QuotedLiteral":W.definition(W.propertyName),"Anchor Alias":W.labelName,Tag:W.typeName,Comment:W.lineComment,": , -":W.separator,"?":W.punctuation,"[ ]":W.squareBracket,"{ }":W.brace}),iBe=Tv.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`,59`OOQO,59c,59cO4VQdO,59cO4aQdO'#CzO4kQ`O'#CzOOQO,59b,59bOOQU,5:Q,5:QOOQR1G.v1G.vO4pQ`O1G.vOOQU-E7d-E7dO4xQdO,59kOOQO,59k,59kO5SQdO'#DQO5^Q`O'#DQOOQO,5:d,5:dOOQU,5:R,5:ROOQR1G/U1G/UO5cQ`O1G/UOOQU-E7e-E7eO5kQgO'#DhO5xQcO1G/XOOQR1G/X1G/XOOQR,59q,59qO6TQgO,59qO6eQdO'#DiO6lQgO'#DiO7PQcO1G/[OOQR1G/[1G/[OOQR,59r,59rO#|QfO,59rOOQR1G/b1G/bO7_OWO1G/bO7dOaO1G/bOOQR,59y,59yOOQR,59{,59{OOQP1G/h1G/hO7lOaO1G/hO7tOaO1G/hO8POaO1G/hOOQP1G.s1G.sO8_QgO,5:POOQP,5:P,5:POOQP,5:V,5:VOOQP-E7i-E7iOOQO,59_,59_OOQO,59a,59aOOQO1G.}1G.}OOQO,59f,59fO8oQdO,59fOOQR7+$b7+$bP,XQ`O'#DfOOQO1G/V1G/VOOQO,59l,59lO8yQdO,59lOOQR7+$p7+$pP9TQ`O'#DgOOQR'#DT'#DTOOQR,5:S,5:SOOQR-E7f-E7fOOQR7+$s7+$sOOQR1G/]1G/]O9YQgO'#DYO9jQ`O'#DYOOQR,5:T,5:TO#|QfO'#DZO9oQcO'#DZOOQR-E7g-E7gOOQR7+$v7+$vOOQR1G/^1G/^OOQR7+$|7+$|O:QOWO7+$|OOQP7+%S7+%SO:VOaO7+%SO:_OaO7+%SOOQP1G/k1G/kOOQO1G/Q1G/QOOQO1G/W1G/WOOQR,59t,59tO:jQgO,59tOOQR,59u,59uO#|QfO,59uOOQR<<Hh<<HhOOQP<<Hn<<HnO:zOaO<<HnOOQR1G/`1G/`OOQR1G/a1G/aOOQPAN>YAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:Q$e,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[rBe],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[X$e,Y$e,tBe,nBe,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),oBe=pv.define({name:"yaml",parser:iBe.configure({props:[B9.add({Stream:e=>{for(let t=e.node.resolve(e.pos,-1);t&&t.to>=e.pos;t=t.parent){if(t.name=="BlockLiteralContent"&&t.from<t.to)return e.baseIndentFor(t);if(t.name=="BlockLiteral")return e.baseIndentFor(t)+e.unit;if(t.name=="BlockSequence"||t.name=="BlockMapping")return e.column(t.firstChild.from,1);if(t.name=="QuotedLiteral")return null;if(t.name=="Literal"){let n=e.column(t.from,1);if(n==e.lineIndent(t.from,1))return n;if(t.to>e.pos)return null}}return null},FlowMapping:zR({closing:"}"}),FlowSequence:zR({closing:"]"})}),W9.add({"FlowMapping FlowSequence":LNe,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function sBe(){return new ANe(oBe)}function kt({label:e,helper:t,error:n,required:r,children:i}){const o=C.useId(),s=`${o}-input`,a=`${o}-helper`,l=`${o}-error`;return g.jsxs("div",{className:"flex flex-col gap-1.5",children:[g.jsxs("label",{htmlFor:s,className:"text-[12px] font-medium text-[var(--color-text)]",children:[e,r?g.jsx("span",{className:"ml-0.5 text-[var(--color-fail)]",children:"*"}):null]}),i({id:s,helperId:a,errorId:l}),n?g.jsx("p",{id:l,className:"text-[12px] text-[var(--color-fail)]",children:n}):t?g.jsx("p",{id:a,className:"text-[12px] text-[var(--color-text-muted)]",children:t}):null]})}const _f={enabled:!1,provider:"anthropic",mode:"auto",auth:{anthropic:"auto"},budget:{maxFileReads:25,maxContextBytes:5e4,maxDurationSeconds:180},cache:{enabled:!0},maxOutputTokens:16384},RD=[{value:"subscription",label:"Claude subscription (browser login)",helper:"Runs on your Claude plan. No API key needed. Sign in with `squad auth login`."},{value:"api-key",label:"Anthropic API key",helper:"Uses ANTHROPIC_API_KEY or the key saved in Secrets."},{value:"auto",label:"Automatic",helper:"Prefers your Claude login when signed in, otherwise falls back to the API key."}];function aBe(){const e=yi(),{toast:t}=Qr(),n=wt({queryKey:["config"],queryFn:()=>Me("/api/config")}),r=wP(),[i,o]=C.useState(null),[s,a]=C.useState(null);C.useEffect(()=>{n.data&&o(structuredClone(n.data))},[n.data]);const l=Ps({mutationFn:y=>Me("/api/config",{method:"PUT",body:JSON.stringify(y)}),onSuccess:()=>{a(null),e.invalidateQueries({queryKey:["config"]}),e.invalidateQueries({queryKey:["meta"]}),e.invalidateQueries({queryKey:rb}),t({tone:"success",title:"Config saved"})},onError:y=>a(y.message)}),u=C.useMemo(()=>i?X_e.dump(i,{lineWidth:100,noRefs:!0,sortKeys:!1}):"",[i]);if(n.isPending||!i)return g.jsx(Ce,{title:"Config",description:"Visual editor for .squad/config.yaml.",children:g.jsx(Tn,{className:"h-96 w-full"})});const c=i.planner?{..._f,...i.planner,budget:{..._f.budget,...i.planner.budget}}:{..._f,enabled:!1};function f(y){o(x=>x&&{...x,planner:y})}const h=c.auth?.anthropic??"auto",d=RD.find(y=>y.value===h)?.helper??"",p=c.enabled&&c.provider==="anthropic",m=r.data?.loginCommand??"squad auth login",v=p&&h==="subscription"&&r.data?.login.present===!1,b=p&&h==="subscription"?r.data?.runtimeConflict??null:null;return g.jsxs(Ce,{title:"Config",description:"Edit workspace settings. Saving runs the same validation as the CLI. YAML tab is read-only — use your editor for raw edits.",children:[s?g.jsx(Ae,{tone:"danger",title:"Could not save",children:s}):null,g.jsx(bP,{tabs:[{id:"form",label:"Form",panel:g.jsxs("div",{className:"space-y-4",children:[g.jsxs(He,{variant:"default",children:[g.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Project"}),g.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[g.jsx(kt,{label:"Name",children:({id:y,helperId:x})=>g.jsx(ct,{id:y,"aria-describedby":x,value:i.project.name,onChange:k=>o({...i,project:{...i.project,name:k.target.value}})})}),g.jsx(kt,{label:"Primary language",children:({id:y,helperId:x})=>g.jsx(ct,{id:y,"aria-describedby":x,value:i.project.primaryLanguage??"",onChange:k=>o({...i,project:{...i.project,primaryLanguage:k.target.value}})})}),g.jsx("div",{className:"sm:col-span-2",children:g.jsx(kt,{label:"Project roots (comma-separated)",helper:"Paths relative to the workspace root.",children:({id:y,helperId:x})=>g.jsx(ct,{id:y,"aria-describedby":x,className:"font-mono",value:(i.project.projectRoots??["."]).join(", "),onChange:k=>o({...i,project:{...i.project,projectRoots:k.target.value.split(",").map(w=>w.trim()).filter(Boolean)}})})})})]})]}),g.jsxs(He,{variant:"default",children:[g.jsx("h2",{className:"mb-3 text-sm font-semibold",children:"Tracker"}),g.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[g.jsx("div",{className:"sm:col-span-2",children:g.jsx(kt,{label:"Type",children:({id:y,helperId:x})=>g.jsxs(La,{id:y,"aria-describedby":x,className:"mt-0 w-full",value:i.tracker.type,onChange:k=>o({...i,tracker:{...i.tracker,type:k.target.value}}),children:[g.jsx("option",{value:"none",children:"none"}),g.jsx("option",{value:"github",children:"github"}),g.jsx("option",{value:"jira",children:"jira"}),g.jsx("option",{value:"azure",children:"azure"})]})})}),g.jsx(kt,{label:"Workspace",helper:"Jira host or Azure org.",children:({id:y,helperId:x})=>g.jsx(ct,{id:y,"aria-describedby":x,placeholder:"host (Jira) or org (Azure)",value:i.tracker.workspace??"",onChange:k=>o({...i,tracker:{...i.tracker,workspace:k.target.value||void 0}})})}),g.jsx(kt,{label:"Project",helper:"Azure project name if applicable.",children:({id:y,helperId:x})=>g.jsx(ct,{id:y,"aria-describedby":x,placeholder:"Azure project name if applicable",value:i.tracker.project??"",onChange:k=>o({...i,tracker:{...i.tracker,project:k.target.value||void 0}})})})]})]}),g.jsxs(He,{variant:"default",children:[g.jsx("h2",{className:"mb-3 text-sm font-semibold",children:"Naming"}),g.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[g.jsx("input",{type:"checkbox",checked:i.naming.includeTrackerId,onChange:y=>o({...i,naming:{...i.naming,includeTrackerId:y.target.checked}})}),"includeTrackerId"]}),g.jsxs("label",{className:"mt-2 flex items-center gap-2 text-sm",children:[g.jsx("input",{type:"checkbox",checked:i.naming.globalSequence,onChange:y=>o({...i,naming:{...i.naming,globalSequence:y.target.checked}})}),"globalSequence"]})]}),g.jsxs(He,{variant:"default",children:[g.jsx("h2",{className:"mb-3 text-sm font-semibold",children:"Agents"}),g.jsx(kt,{label:"Agent ids",helper:"One id per line.",children:({id:y,helperId:x})=>g.jsx("textarea",{id:y,"aria-describedby":x,className:"w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-bg-elevated)] px-3 py-2 font-mono text-sm text-[var(--color-text)]",rows:4,placeholder:"One agent id per line",value:i.agents.join(`
|
|
441
|
-
`),onChange:k=>o({...i,agents:k.target.value.split(`
|
|
442
|
-
`).map(w=>w.trim()).filter(Boolean)})})})]}),g.jsxs(He,{variant:"default",children:[g.jsx("h2",{className:"mb-3 text-sm font-semibold",children:"Planner"}),g.jsxs("label",{className:"mb-2 flex items-center gap-2 text-sm",children:[g.jsx("input",{type:"checkbox",checked:c.enabled,onChange:y=>{y.target.checked?f({..._f,...i.planner,enabled:!0,budget:{..._f.budget,...i.planner?.budget}}):f({...c,enabled:!1})}}),"Enabled"]}),c.enabled&&g.jsxs("div",{className:"mt-3 grid gap-3 sm:grid-cols-2",children:[g.jsx(kt,{label:"Provider",children:({id:y,helperId:x})=>g.jsxs(La,{id:y,"aria-describedby":x,className:"w-full",value:c.provider,onChange:k=>f({...c,provider:k.target.value}),children:[g.jsx("option",{value:"anthropic",children:"anthropic"}),g.jsx("option",{value:"openai",children:"openai"}),g.jsx("option",{value:"google",children:"google"})]})}),c.provider==="anthropic"?g.jsx(kt,{label:"Authentication",helper:d,children:({id:y,helperId:x})=>g.jsx(La,{id:y,"aria-describedby":x,className:"w-full",value:h,onChange:k=>f({...c,auth:{...c.auth,anthropic:k.target.value}}),children:RD.map(k=>g.jsx("option",{value:k.value,children:k.label},k.value))})}):null,v?g.jsx("div",{className:"sm:col-span-2",children:g.jsxs(Ae,{tone:"warning",title:"No Claude login detected",children:[g.jsx("p",{children:"Subscription mode is fine to save now — the next run will fail until you sign in."}),g.jsx(xP,{className:"mt-2",command:m})]})}):null,b?g.jsx("div",{className:"sm:col-span-2",children:g.jsx(Ae,{tone:"danger",title:"Subscription auth cannot use this runtime",children:b})}):null,g.jsx(kt,{label:"Max output tokens",children:({id:y,helperId:x})=>g.jsx(ct,{id:y,"aria-describedby":x,type:"number",value:c.maxOutputTokens??16384,onChange:k=>f({...c,maxOutputTokens:Number(k.target.value)||16384})})}),g.jsx("div",{className:"sm:col-span-2",children:g.jsx(kt,{label:"Model overrides (optional)",helper:"Provider → model id.",children:({id:y,helperId:x})=>g.jsxs("div",{id:y,"aria-describedby":x,className:"mt-0 grid gap-2 sm:grid-cols-3",children:[g.jsx(ct,{placeholder:"anthropic",className:"font-mono text-xs",value:c.modelOverride?.anthropic??"",onChange:k=>f({...c,modelOverride:{...c.modelOverride,anthropic:k.target.value||void 0}})}),g.jsx(ct,{placeholder:"openai",className:"font-mono text-xs",value:c.modelOverride?.openai??"",onChange:k=>f({...c,modelOverride:{...c.modelOverride,openai:k.target.value||void 0}})}),g.jsx(ct,{placeholder:"google",className:"font-mono text-xs",value:c.modelOverride?.google??"",onChange:k=>f({...c,modelOverride:{...c.modelOverride,google:k.target.value||void 0}})})]})})}),g.jsx(kt,{label:"Budget: max file reads",children:({id:y,helperId:x})=>g.jsx(ct,{id:y,"aria-describedby":x,type:"number",value:c.budget.maxFileReads,onChange:k=>f({...c,budget:{...c.budget,maxFileReads:Number(k.target.value)||1}})})}),g.jsx(kt,{label:"Max context bytes",children:({id:y,helperId:x})=>g.jsx(ct,{id:y,"aria-describedby":x,type:"number",value:c.budget.maxContextBytes,onChange:k=>f({...c,budget:{...c.budget,maxContextBytes:Number(k.target.value)||1}})})}),g.jsx(kt,{label:"Max duration (sec)",children:({id:y,helperId:x})=>g.jsx(ct,{id:y,"aria-describedby":x,type:"number",value:c.budget.maxDurationSeconds,onChange:k=>f({...c,budget:{...c.budget,maxDurationSeconds:Number(k.target.value)||1}})})}),g.jsxs("label",{className:"flex items-center gap-2 text-sm sm:col-span-2",children:[g.jsx("input",{type:"checkbox",checked:c.cache?.enabled!==!1,onChange:y=>f({...c,cache:{enabled:y.target.checked}})}),"Prompt cache enabled"]})]})]}),g.jsx("div",{className:"flex justify-end",children:g.jsx(fe,{type:"button",disabled:!!b,onClick:()=>l.mutate({...i,planner:c}),loading:l.isPending,children:"Save changes"})})]})},{id:"yaml",label:"YAML",panel:g.jsx("div",{className:"overflow-hidden rounded-lg border border-[var(--color-border)]",children:g.jsx(nU,{value:u,height:"min(60vh, 480px)",theme:"dark",extensions:[sBe()],editable:!1})})}]})]})}async function Mm(e){const t=sessionStorage.getItem("squad.console.token");if(!t)throw new kr;const n=await fetch(e,{method:"POST",headers:{authorization:`Bearer ${t}`,"content-type":"application/json"}});if(n.status===401)throw new kr;return await n.json()}function Ml({label:e,helper:t,display:n,onSave:r}){const[i,o]=C.useState(!1),[s,a]=C.useState("");return i?g.jsx(kt,{label:e,helper:t,children:({id:l,helperId:u})=>g.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[g.jsx(ct,{id:l,"aria-describedby":u,type:"password",className:"flex-1",value:s,onChange:c=>a(c.target.value),autoComplete:"off"}),g.jsxs("div",{className:"flex gap-2",children:[g.jsx(fe,{type:"button",onClick:()=>{r(s),o(!1),a("")},children:"Save"}),g.jsx(fe,{type:"button",variant:"secondary",onClick:()=>{o(!1),a("")},children:"Cancel"})]})]})}):g.jsxs("div",{children:[g.jsx("div",{className:"text-[12px] font-medium text-[var(--color-text)]",children:e}),g.jsx("p",{className:"text-[12px] text-[var(--color-text-muted)]",children:t}),g.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[g.jsx("code",{className:"max-w-full break-all rounded bg-[var(--color-surface)] px-2 py-1 text-sm",children:n??"—"}),g.jsx(fe,{type:"button",variant:"secondary",onClick:()=>{a(""),o(!0)},children:"Edit"})]})]})}function lBe({auth:e,storedToken:t,onRemoveToken:n,removing:r}){const i=STe();if(e.provider!=="anthropic")return null;if(e.resolved?.mode==="api-key")return g.jsxs(He,{variant:"default",children:[g.jsx("h2",{className:"mb-2 text-sm font-semibold",children:"Claude account"}),g.jsxs("p",{className:"text-[13px] text-[var(--color-text-muted)]",children:["Using an Anthropic API key. Switch to your Claude subscription in"," ",g.jsx(vt,{to:"/config",className:"text-[var(--color-accent)] underline",children:"Config"}),"."]})]});const o=kTe(e),s=OTe(e),a=CTe(e),l=e.login.hint==="oauth-token-env"&&t!==null;return g.jsxs(He,{variant:"default",children:[g.jsxs("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-2",children:[g.jsx("h2",{className:"text-sm font-semibold",children:"Claude account"}),g.jsx(fe,{type:"button",variant:"secondary",size:"sm",loading:i.isPending,onClick:()=>i.mutate(),children:"Check again"})]}),o?g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[13px]",children:[g.jsx(Ee,{tone:"success",dot:!0,children:"Signed in"}),i.isPending?g.jsxs("span",{className:"flex items-center gap-2 text-[var(--color-text-muted)]",children:[g.jsx(Yd,{}),"Checking…"]}):g.jsx("span",{className:"text-[var(--color-text)]",children:a??e.resolved?.credentialHint??"—"})]}),e.apiKeySource?g.jsxs("p",{className:"text-[12px] text-[var(--color-text-muted)]",children:["apiKeySource: ",e.apiKeySource]}):null,s?g.jsx("p",{className:"text-[12px] text-[var(--color-text-muted)]",children:s}):null,t?g.jsxs("div",{className:"pt-1",children:[g.jsx("div",{className:"text-[12px] font-medium text-[var(--color-text)]",children:"Stored token"}),g.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[g.jsx("code",{className:"rounded bg-[var(--color-surface)] px-2 py-1 text-sm",children:t}),g.jsx(fe,{type:"button",variant:"secondary",size:"sm",loading:r,onClick:n,children:"Remove"})]}),l?g.jsx("p",{className:"mt-1 text-[12px] text-[var(--color-text-muted)]",children:"CLAUDE_CODE_OAUTH_TOKEN is set in the environment and takes precedence over this stored token."}):null]}):null]}):g.jsxs("div",{className:"space-y-2",children:[g.jsx(Ee,{tone:"muted",dot:!0,children:"Not signed in"}),g.jsx("p",{className:"text-[13px] text-[var(--color-text-muted)]",children:"No Claude login was found on this machine, so subscription runs have nothing to authenticate with. Sign in from your terminal — the console cannot open the browser login for you."}),g.jsx(xP,{command:e.loginCommand}),s?g.jsx("p",{className:"text-[12px] text-[var(--color-text-muted)]",children:s}):null]})]})}function uBe(){const e=yi(),{toast:t}=Qr(),[n,r]=C.useState(null),[i,o]=C.useState(""),[s,a]=C.useState(""),[l,u]=C.useState(""),[c,f]=C.useState(""),[h,d]=C.useState(""),[p,m]=C.useState(null),[v,b]=C.useState(null),[y,x]=C.useState(null),[k,w]=C.useState(null),[S,O]=C.useState(null),[A,P]=C.useState(null),[M,j]=C.useState(null),E=wt({queryKey:["secrets"],queryFn:()=>Me("/api/secrets")}),D=wP(),R=C.useRef(!1),N=Ps({mutationFn:I=>Me("/api/secrets",{method:"PUT",body:JSON.stringify(I)}),onSuccess:()=>{r(null),e.invalidateQueries({queryKey:["secrets"]}),e.invalidateQueries({queryKey:rb}),t({tone:"success",title:"Secrets saved"})},onError:I=>r(I.message)});C.useEffect(()=>{!E.data||R.current||(R.current=!0,o(E.data.tracker.jira.host??""),a(E.data.tracker.jira.email??""),u(E.data.tracker.azure.organization??""),f(E.data.tracker.azure.project??""),d(E.data.tracker.github.host??""))},[E.data]);async function B(I,_){j(I),_(null);try{const K=await Mm(`/api/secrets/test/${I}`);if(K&&"ok"in K&&K.ok)_({ok:!0,message:`${K.modelCount} models accessible`});else{const Q=K.detail??"failed",te=K.status;_({ok:!1,message:te?`HTTP ${te} — ${Q}`:String(Q)})}}catch(K){_({ok:!1,message:K.message})}finally{j(null)}}async function F(){j("jira"),w(null);try{const I=await Mm("/api/secrets/test/jira");I.ok?w({ok:!0,message:"Jira reachable"}):w({ok:!1,message:I.detail?`Jira: ${I.detail}`:"unreachable"})}catch(I){w({ok:!1,message:I.message})}finally{j(null)}}async function $(){j("azure"),O(null);try{const I=await Mm("/api/secrets/test/azure");I.ok?O({ok:!0,message:"Azure DevOps reachable"}):O({ok:!1,message:I.detail?`Azure: ${I.detail}`:"unreachable"})}catch(I){O({ok:!1,message:I.message})}finally{j(null)}}async function z(){j("github"),P(null);try{const I=await Mm("/api/secrets/test/github");I.ok?P({ok:!0,message:"GitHub reachable"}):P({ok:!1,message:I.detail?`GitHub: ${I.detail}`:"unreachable"})}catch(I){P({ok:!1,message:I.message})}finally{j(null)}}if(E.isPending||!E.data)return g.jsx(Ce,{title:"Secrets",description:"Stored in .squad/secrets.yaml. Never committed.",children:g.jsx("p",{className:"text-[var(--color-text-muted)]",children:"Loading…"})});const T=E.data,q=D.data?.resolved?.mode==="subscription";return g.jsxs(Ce,{title:"Secrets",description:"Stored in .squad/secrets.yaml. Never committed.",children:[g.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Values are masked on read. For provider tests, save the key first, then test (the server only uses stored secrets)."}),n?g.jsx(Ae,{tone:"danger",children:n}):null,g.jsxs("div",{className:"space-y-4",children:[D.data?g.jsx(lBe,{auth:D.data,storedToken:T.planner.anthropicOauthToken,removing:N.isPending,onRemoveToken:()=>N.mutate({planner:{anthropicOauthToken:""}})}):null,g.jsxs(He,{variant:"default",children:[g.jsx("h2",{className:"mb-3 text-sm font-semibold",children:"Planner"}),g.jsxs("div",{className:"space-y-4",children:[g.jsx("div",{className:q?"opacity-60":void 0,children:g.jsx(Ml,{label:"Anthropic API key",helper:"Stored in .squad/secrets.yaml; never committed.",display:T.planner.anthropic,onSave:I=>N.mutate({planner:{anthropic:I}})})}),p?g.jsx(Ee,{tone:p.ok?"success":"danger",children:p.ok?"reachable":"failed"}):null,g.jsx("div",{className:"flex flex-wrap gap-2",children:g.jsx(fe,{type:"button",variant:"secondary",size:"sm",loading:M==="anthropic",onClick:async()=>{m(null),await B("anthropic",m)},children:"Test connection"})}),g.jsx(Ml,{label:"OpenAI API key",helper:"Stored in .squad/secrets.yaml; never committed.",display:T.planner.openai,onSave:I=>N.mutate({planner:{openai:I}})}),v?g.jsx(Ee,{tone:v.ok?"success":"danger",children:v.ok?"reachable":"failed"}):null,g.jsx(fe,{type:"button",variant:"secondary",size:"sm",loading:M==="openai",onClick:async()=>{b(null),await B("openai",b)},children:"Test connection"}),g.jsx(Ml,{label:"Google API key",helper:"Stored in .squad/secrets.yaml; never committed.",display:T.planner.google,onSave:I=>N.mutate({planner:{google:I}})}),y?g.jsx(Ee,{tone:y.ok?"success":"danger",children:y.ok?"reachable":"failed"}):null,g.jsx(fe,{type:"button",variant:"secondary",size:"sm",loading:M==="google",onClick:async()=>{x(null),await B("google",x)},children:"Test connection"})]})]}),g.jsxs(He,{variant:"default",children:[g.jsx("h2",{className:"mb-3 text-sm font-semibold",children:"Jira"}),g.jsxs("div",{className:"grid max-w-lg gap-3",children:[g.jsx(kt,{label:"Host",children:({id:I,helperId:_})=>g.jsx(ct,{id:I,"aria-describedby":_,className:"mt-0",value:i,onChange:K=>o(K.target.value)})}),g.jsx(kt,{label:"Email",children:({id:I,helperId:_})=>g.jsx(ct,{id:I,"aria-describedby":_,className:"mt-0",value:s,onChange:K=>a(K.target.value)})}),g.jsx(Ml,{label:"Token",helper:"Jira API token; stored in secrets.",display:T.tracker.jira.token,onSave:I=>N.mutate({tracker:{jira:{token:I}}})}),g.jsxs("div",{className:"flex flex-wrap gap-2",children:[g.jsx(fe,{type:"button",onClick:()=>N.mutate({tracker:{jira:{host:i,email:s}}}),loading:N.isPending,children:"Save Jira fields"}),g.jsx(fe,{type:"button",variant:"secondary",loading:M==="jira"||N.isPending,onClick:async()=>{w(null);try{await N.mutateAsync({tracker:{jira:{host:i,email:s}}}),await F()}catch{}},children:"Save and test"})]}),k?g.jsx(Ee,{tone:k.ok?"success":"danger",children:k.message}):null]})]}),g.jsxs(He,{variant:"default",children:[g.jsx("h2",{className:"mb-3 text-sm font-semibold",children:"Azure"}),g.jsxs("div",{className:"grid max-w-lg gap-3",children:[g.jsx(kt,{label:"Organization",children:({id:I,helperId:_})=>g.jsx(ct,{id:I,"aria-describedby":_,className:"mt-0",value:l,onChange:K=>u(K.target.value)})}),g.jsx(kt,{label:"Project",children:({id:I,helperId:_})=>g.jsx(ct,{id:I,"aria-describedby":_,className:"mt-0",value:c,onChange:K=>f(K.target.value)})}),g.jsx(Ml,{label:"PAT",helper:"Azure DevOps personal access token.",display:T.tracker.azure.pat,onSave:I=>N.mutate({tracker:{azure:{pat:I}}})}),g.jsxs("div",{className:"flex flex-wrap gap-2",children:[g.jsx(fe,{type:"button",onClick:()=>N.mutate({tracker:{azure:{organization:l,project:c}}}),loading:N.isPending,children:"Save Azure fields"}),g.jsx(fe,{type:"button",variant:"secondary",loading:M==="azure"||N.isPending,onClick:async()=>{O(null);try{await N.mutateAsync({tracker:{azure:{organization:l,project:c}}}),await $()}catch{}},children:"Save and test"})]}),S?g.jsx(Ee,{tone:S.ok?"success":"danger",children:S.message}):null]})]}),g.jsxs(He,{variant:"default",children:[g.jsx("h2",{className:"mb-3 text-sm font-semibold",children:"GitHub"}),g.jsxs("p",{className:"mb-3 text-[12px] text-[var(--color-text-muted)]",children:["Owner and repo come from ",g.jsx("code",{children:"tracker.workspace"})," and ",g.jsx("code",{children:"tracker.project"})," on the Config page."]}),g.jsxs("div",{className:"grid max-w-lg gap-3",children:[g.jsx(kt,{label:"Host",helper:"Leave blank for github.com; set for GitHub Enterprise Server (e.g. ghes.example.com).",children:({id:I,helperId:_})=>g.jsx(ct,{id:I,"aria-describedby":_,className:"mt-0",placeholder:"api.github.com",value:h,onChange:K=>d(K.target.value)})}),g.jsx(Ml,{label:"Personal access token",helper:"GitHub PAT with repo (or fine-grained Issues: read) scope.",display:T.tracker.github.pat,onSave:I=>N.mutate({tracker:{github:{pat:I}}})}),g.jsxs("div",{className:"flex flex-wrap gap-2",children:[g.jsx(fe,{type:"button",onClick:()=>N.mutate({tracker:{github:{host:h}}}),loading:N.isPending,children:"Save GitHub fields"}),g.jsx(fe,{type:"button",variant:"secondary",loading:M==="github"||N.isPending,onClick:async()=>{P(null);try{await N.mutateAsync({tracker:{github:{host:h}}}),await z()}catch{}},children:"Save and test"})]}),A?g.jsx(Ee,{tone:A.ok?"success":"danger",children:A.message}):null]})]})]})]})}function cBe(e){return e.toLowerCase().trim().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"").slice(0,80)}function fBe(){const e=_r(),{toast:t}=Qr(),[n,r]=C.useState(""),[i,o]=C.useState(""),[s,a]=C.useState(null),[l,u]=C.useState(null),[c,f]=C.useState(!1),[h,d]=C.useState(!1),[p,m]=C.useState(null),[v,b]=C.useState(""),[y,x]=C.useState(!0),[k,w]=C.useState(!1);C.useEffect(()=>{const A=setTimeout(()=>o(n),300);return()=>clearTimeout(A)},[n]),C.useEffect(()=>{let A=!1;return(async()=>{if(i!==void 0){f(!0),u(null);try{const P=sessionStorage.getItem("squad.console.token");if(!P)throw new kr;const M=await fetch(`/api/tracker/search?q=${encodeURIComponent(i)}`,{headers:{authorization:`Bearer ${P}`}});if(M.status===400){const E=await M.json();u(E.detail||E.error||"Search unavailable"),a(null);return}if(!M.ok){u(`HTTP ${M.status}`),a(null);return}const j=await M.json();if(A)return;j.ok&&j.results?a(j.results):(a([]),j.detail&&u(j.detail))}catch(P){A||u(P.message)}finally{A||f(!1)}}})(),()=>{A=!0}},[i]);function S(A){m(A),b(cBe(A.type??"imported")||"imported"),x(!0),d(!0)}async function O(){if(p){w(!0);try{const A=await Me("/api/tracker/import",{method:"POST",body:JSON.stringify({issueId:p.id,feature:v,withAttachments:y})});d(!1);const P=`${A.feature}/${A.id}`;t({tone:"success",title:"Imported as story",description:P}),e({to:"/stories/$feature/$id",params:{feature:A.feature,id:A.id}})}catch(A){u(A.message)}finally{w(!1)}}}return g.jsxs(Ce,{title:"Tracker",description:"Search Jira, Azure, or GitHub issues and import as stories. Configure the tracker in Config and credentials in Secrets.",children:[g.jsx("div",{className:"max-w-2xl",children:g.jsx(ct,{leftSlot:g.jsx(n0,{size:14}),placeholder:"Search issues…",value:n,onChange:A=>r(A.target.value)})}),l&&!c&&g.jsx(Ae,{tone:"warning",title:"Search",children:l}),c&&g.jsx("div",{className:"space-y-2",children:Array.from({length:4}).map((A,P)=>g.jsx(Tn,{className:"h-9"},P))}),!c&&s&&s.length===0&&!l&&g.jsx(Ae,{tone:"info",children:"No results. Try a different query or check tracker configuration."}),!c&&s&&s.length>0&&g.jsx("ul",{className:"overflow-hidden rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)]",children:s.map((A,P)=>g.jsxs("li",{className:`flex items-center gap-3 border-[var(--color-border)] px-3 py-[var(--space-row-y)] text-[13px] ${P>0?"border-t":""}`,children:[g.jsx("a",{href:A.url,target:"_blank",rel:"noreferrer",className:"w-24 shrink-0 font-mono text-[12px] text-[var(--color-accent)] hover:underline",children:A.id}),g.jsx("span",{className:"min-w-0 flex-1 truncate text-[var(--color-text)]",children:A.title}),g.jsxs(Ee,{tone:"default",children:[A.type??"—"," · ",A.status??"—"]}),g.jsx(fe,{type:"button",size:"sm",onClick:()=>S(A),children:"Import"})]},A.id))}),g.jsxs("p",{className:"text-[12px] text-[var(--color-text-dim)]",children:["Configure the tracker in"," ",g.jsx(vt,{to:"/config",className:"text-[var(--color-accent)] underline",children:"Config"})," ","and credentials in"," ",g.jsx(vt,{to:"/secrets",className:"text-[var(--color-accent)] underline",children:"Secrets"}),"."]}),g.jsx(Tc,{open:h,onClose:()=>d(!1),title:"Import as story",footer:g.jsxs("div",{className:"flex w-full flex-wrap justify-end gap-2",children:[g.jsx(fe,{type:"button",variant:"secondary",onClick:()=>d(!1),children:"Cancel"}),g.jsx(fe,{type:"button",onClick:O,disabled:k||!v.trim(),loading:k,children:"Import"})]}),children:g.jsxs("div",{className:"space-y-3 text-sm",children:[g.jsxs("p",{children:["Issue: ",p?.id," — ",p?.title]}),g.jsxs("label",{className:"block text-[var(--color-text-muted)]",children:["Feature slug",g.jsx(ct,{className:"mt-1",value:v,onChange:A=>b(A.target.value)})]}),g.jsxs("label",{className:"flex items-center gap-2",children:[g.jsx("input",{type:"checkbox",checked:y,onChange:A=>x(A.target.checked)}),"Download attachments"]})]})})]})}function hBe(e){return{ok:"var(--color-ok)",warn:"var(--color-warn)",fail:"var(--color-fail)",skip:"var(--color-text-dim)"}[e]}function dBe(e){return{ok:"success",warn:"warning",fail:"danger",skip:"default"}[e]}function pBe(){const[e,t]=C.useState(null),[n,r]=C.useState({}),[i,o]=C.useState(!1),[s,a]=C.useState(!1),[l,u]=C.useState(null);async function c(f){u(null),f?a(!0):o(!0);try{const h=await Me(f?"/api/doctor/fix":"/api/doctor",{method:f?"POST":"GET"});t(h)}catch(h){u(h.message)}finally{o(!1),a(!1)}}return g.jsxs(Ce,{title:"Doctor",description:"Graphical view of the same checks as `squad doctor`.",actions:g.jsx(fe,{type:"button",onClick:()=>void c(!1),loading:i,leftIcon:g.jsx(uX,{size:14}),children:"Run checks"}),children:[l?g.jsx(Ae,{tone:"danger",children:l}):null,i&&!e&&g.jsx("div",{className:"space-y-2",children:Array.from({length:12}).map((f,h)=>g.jsx(Tn,{className:"h-10 w-full"},h))}),e&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"flex flex-wrap gap-3 text-[13px]",children:[g.jsxs(Ee,{tone:"success",children:[e.summary.ok," ok"]}),g.jsxs(Ee,{tone:"warning",children:[e.summary.warn," warn"]}),g.jsxs(Ee,{tone:"danger",children:[e.summary.fail," fail"]}),g.jsxs(Ee,{tone:"default",children:[e.summary.skip," skip"]})]}),g.jsx(He,{variant:"flat",className:"p-0 overflow-hidden",children:g.jsx("ul",{children:e.checks.map(f=>g.jsxs("li",{className:"border-t border-[var(--color-border)] first:border-t-0",children:[g.jsxs("button",{type:"button",className:"flex w-full items-start gap-3 px-3 py-3 text-left transition-colors hover:bg-[var(--gray-4)]",onClick:()=>r(h=>({...h,[f.id]:!h[f.id]})),children:[g.jsx("span",{"aria-hidden":!0,style:{background:hBe(f.status)},className:"mt-1 h-2 w-2 shrink-0 rounded-full"}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(Ee,{tone:dBe(f.status),children:f.status}),g.jsx("span",{className:"text-[13px] font-medium",children:f.name})]}),n[f.id]&&f.detail?g.jsx("pre",{className:"mt-2 whitespace-pre-wrap break-words text-[12px] text-[var(--color-text-muted)]",children:f.detail}):null]})]}),f.fixable&&f.status==="warn"?g.jsx("div",{className:"px-3 pb-3",children:g.jsx(fe,{variant:"secondary",size:"sm",onClick:()=>void c(!0),loading:s,leftIcon:g.jsx(TF,{size:14}),children:"Apply repair"})}):null]},f.id+f.name))})})]})]})}const DD=[{inputTokens:12e3,outputTokens:2e3,durationMs:14200},{inputTokens:8200,outputTokens:1100,durationMs:9400},{inputTokens:15e3,outputTokens:3200,durationMs:22e3}];function mBe(){const{design:e}=Ec({from:"/__design"}),{toast:t}=Qr(),n=r0();return e!=="1"?g.jsx(Ce,{title:"Design playground",description:"Internal only — add the query param to view.",children:g.jsxs(Ae,{tone:"info",children:["Append ",g.jsx(Wi,{children:"design=1"})," to the URL to open the internal design playground."]})}):g.jsxs(Ce,{title:"Design playground",description:"Internal: every primitive on one page. Visit /__design?design=1.",children:[g.jsx(He,{header:"Buttons",children:g.jsxs("div",{className:"flex flex-wrap gap-3",children:[g.jsx(fe,{children:"Primary"}),g.jsx(fe,{variant:"secondary",children:"Secondary"}),g.jsx(fe,{variant:"ghost",leftIcon:g.jsx(ZC,{size:14}),children:"Ghost"}),g.jsx(fe,{variant:"danger",leftIcon:g.jsx(zh,{size:14}),children:"Danger"}),g.jsx(fe,{loading:!0,children:"Loading"}),g.jsx(fe,{size:"sm",children:"Small"})]})}),g.jsx(He,{header:"Badges",children:g.jsx("div",{className:"flex flex-wrap gap-2",children:["default","success","warning","danger","info"].map(r=>g.jsx(Ee,{tone:r,dot:!0,children:r},r))})}),g.jsx(He,{header:"Callouts",children:g.jsx("div",{className:"space-y-2",children:["default","info","success","warning","danger"].map(r=>g.jsxs(Ae,{tone:r,title:`${r} callout`,children:["This is the body of a ",r," callout."]},r))})}),g.jsx(He,{header:"Inputs",children:g.jsxs("div",{className:"space-y-3",children:[g.jsx(kt,{label:"Name",helper:"Lowercase only.",children:({id:r,helperId:i})=>g.jsx(ct,{id:r,"aria-describedby":i,placeholder:"story-id"})}),g.jsx(kt,{label:"Search",helper:"Optional.",children:({id:r})=>g.jsx(ct,{id:r,leftSlot:g.jsx(n0,{size:14}),placeholder:"Find issues…"})}),g.jsxs(La,{defaultValue:"anthropic",children:[g.jsx("option",{value:"anthropic",children:"Anthropic"}),g.jsx("option",{value:"openai",children:"OpenAI"}),g.jsx("option",{value:"google",children:"Google"})]})]})}),g.jsx(He,{header:"Toast & Confirm",children:g.jsxs("div",{className:"flex flex-wrap gap-2",children:[g.jsx(fe,{onClick:()=>t({title:"Saved",tone:"success"}),children:"Show toast"}),g.jsx(fe,{variant:"danger",onClick:async()=>{const r=await n({title:"Delete?",description:"This cannot be undone.",tone:"danger"});t({title:r?"Confirmed":"Cancelled"})},children:"Confirm…"})]})}),g.jsxs(He,{header:"Tabs / Skeleton / Spinner / Kbd / Tooltip / IconButton",children:[g.jsx(bP,{tabs:[{id:"one",label:"Tab one",panel:g.jsx("p",{children:"Panel one"})},{id:"two",label:"Tab two",panel:g.jsx(Tn,{className:"h-9 w-1/2"})}]}),g.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[g.jsx(Yd,{}),g.jsx(Wi,{children:"⌘"}),g.jsx(Wi,{children:"K"}),g.jsx(Wg,{label:"Hello",children:g.jsx("span",{className:"text-sm",children:"Hover me"})}),g.jsx(Nk,{icon:g.jsx(zh,{size:14}),label:"Trash"})]})]}),g.jsx(He,{header:"Charts (sample data)",children:g.jsxs("div",{className:"flex flex-wrap items-center gap-6",children:[g.jsx(nP,{ratio:.74}),g.jsx("div",{className:"min-w-0 flex-1 basis-[min(100%,240px)]",children:g.jsx(xz,{runs:DD})}),g.jsx("div",{className:"min-w-0 flex-1 basis-[min(100%,240px)]",children:g.jsx(bz,{runs:DD})})]})})]})}function gBe(e){const t=e.plannerRuntime?.kind;return t==="agent-sdk"?"Agent SDK":t==="vercel"?"Vercel":"—"}function yBe({mode:e}){return e?g.jsx(Ee,{tone:e==="subscription"?"info":"muted",title:e,children:e==="subscription"?"sub":"key"}):g.jsx("span",{className:"text-[var(--color-text-muted)]",children:"—"})}function vBe(){const e=_r(),t=wt({queryKey:["runs"],queryFn:()=>Me("/api/runs")});if(t.isPending)return g.jsx(Ce,{title:"Runs",description:"The last 20 planner runs on this project.",children:g.jsx("div",{className:"space-y-2",children:Array.from({length:6}).map((r,i)=>g.jsx(Tn,{className:"h-9 w-full"},i))})});if(t.isError)return g.jsx(Ce,{title:"Runs",description:"The last 20 planner runs on this project.",children:g.jsx(Ae,{tone:"danger",children:t.error.message})});const n=t.data??[];return g.jsx(Ce,{title:"Runs",description:"The last 20 planner runs on this project.",children:n.length===0?g.jsxs(Ae,{tone:"info",title:"No runs yet",children:[g.jsx("p",{className:"mb-4 text-[13px] text-[var(--color-text-muted)]",children:"Go to Generate to start one."}),g.jsx(vt,{to:"/generate",children:g.jsx(fe,{type:"button",variant:"primary",children:"Open Generate"})})]}):g.jsx("div",{className:"overflow-auto rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)]",children:g.jsxs("table",{className:"w-full min-w-[940px] table-fixed border-collapse text-left text-[13px]",children:[g.jsx("thead",{className:"bg-[var(--gray-2)] text-[var(--color-text-muted)]",children:g.jsxs("tr",{children:[g.jsx("th",{className:"border-b border-[var(--color-border)] px-3 py-2 font-medium w-[10rem]",children:"Started"}),g.jsx("th",{className:"border-b border-[var(--color-border)] px-3 py-2 font-medium w-[220px]",children:"Feature / story"}),g.jsx("th",{className:"border-b border-[var(--color-border)] px-3 py-2 font-medium",children:"Model"}),g.jsx("th",{className:"border-b border-[var(--color-border)] px-3 py-2 font-medium w-[6rem]",children:"Runtime"}),g.jsx("th",{className:"border-b border-[var(--color-border)] px-3 py-2 font-medium w-[5rem]",children:"Auth"}),g.jsx("th",{className:"border-b border-[var(--color-border)] px-3 py-2 font-medium tabular text-right w-[5rem]",children:"Duration"}),g.jsx("th",{className:"border-b border-[var(--color-border)] px-3 py-2 font-medium tabular text-right w-[6rem]",children:"Tokens"}),g.jsx("th",{className:"border-b border-[var(--color-border)] px-3 py-2 font-medium tabular text-right w-[5rem]",children:"Cache"}),g.jsx("th",{className:"border-b border-[var(--color-border)] px-3 py-2 font-medium w-[7rem]",children:"Validation"}),g.jsx("th",{className:"border-b border-[var(--color-border)] px-3 py-2 font-medium w-[6rem]",children:"Status"})]})}),g.jsx("tbody",{children:n.map((r,i)=>{const o=r.stats?.inputTokens??0,s=r.stats?.outputTokens??0,a=o+s,l=r.stats?.cacheHitRatio!=null?Math.round(r.stats.cacheHitRatio*100):null,u=Math.max(1,Math.round(r.durationMs/1e3)),c=r.validation?.issuesCount??0,f=r.success?"success":r.partial?"warning":"danger";return g.jsxs("tr",{"aria-label":`Run ${r.runId}`,tabIndex:0,role:"link",onClick:()=>void e({to:"/runs/$runId",params:{runId:r.runId},search:{tab:"plan"}}),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&e({to:"/runs/$runId",params:{runId:r.runId},search:{tab:"plan"}})},className:`${i>0?"border-t border-[var(--color-border)] ":""}cursor-pointer transition-colors hover:bg-[var(--gray-3)]`,children:[g.jsx("td",{className:"truncate px-3 py-[var(--space-row-y)] text-[var(--color-text-muted)] tabular whitespace-nowrap",children:bBe(r.startedAt)}),g.jsxs("td",{className:"truncate px-3 py-[var(--space-row-y)] font-mono text-[12px]",children:[g.jsx("span",{title:`${r.feature}/${r.storyId}`,children:r.feature})," ",g.jsx("span",{className:"text-[var(--color-text-muted)]",children:"/"})," ",g.jsx("span",{children:r.storyId})]}),g.jsx("td",{className:"truncate px-3 py-[var(--space-row-y)] font-mono text-[12px] text-[var(--color-text-muted)]",children:r.model}),g.jsx("td",{className:"px-3 py-[var(--space-row-y)]",children:gBe(r)}),g.jsx("td",{className:"px-3 py-[var(--space-row-y)]",children:g.jsx(yBe,{mode:r.authMode})}),g.jsxs("td",{className:"px-3 py-[var(--space-row-y)] tabular text-right",children:[u,"s"]}),g.jsx("td",{className:"px-3 py-[var(--space-row-y)] tabular text-right",children:a}),g.jsx("td",{className:"px-3 py-[var(--space-row-y)] tabular text-right",children:l!=null?`${l}%`:"—"}),g.jsx("td",{className:"px-3 py-[var(--space-row-y)]",children:g.jsxs(vt,{to:"/runs/$runId",params:{runId:r.runId},search:{tab:"issues"},onClick:h=>h.stopPropagation(),className:`${c?"font-medium text-[var(--color-accent)] hover:underline":"text-[var(--color-text-muted)] hover:underline"}`,children:[c," ",c===1?"issue":"issues"]})}),g.jsx("td",{className:"px-3 py-[var(--space-row-y)]",children:g.jsx(Ee,{tone:f,children:r.success?"success":r.partial?"partial":"failed"})})]},r.runId)})})]})})})}function bBe(e){const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}const xBe=8192;function wBe(e){return e instanceof Error&&/\b404\b/.test(e.message)}function SBe(e){const t=e.toLowerCase();return t==="openai"||t==="google"||t==="anthropic"?t:"anthropic"}function cU(e){return e.slice(0,8)}function fU(e){const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function hU(e){const t=e.stats,n=t?.inputTokens??0,r=t?.outputTokens??0,i=n+r,o=Math.max(Math.ceil(i*1.15),xBe),s={maxFileReads:500,maxContextBytes:4194304,maxDurationSeconds:3600},a=e.model?{provider:SBe(e.provider),model:e.model,runtimeKind:e.plannerRuntime?.kind??"agent-sdk",cacheEnabled:e.cacheEnabled??!0,scoutEnabled:!0,validationEnabled:!0,budgetCaps:s,providerOptions:e.providerOptionsSnapshot}:null,l=Number.isFinite(Date.parse(e.startedAt))?Date.parse(e.startedAt):Date.now(),u=e.authMode?{mode:e.authMode}:null;return{...Xy,phase:"streaming",runId:e.runId,feature:e.feature,storyId:e.storyId,mode:"api",startedAtMs:l,runtime:a,auth:u,budget:a?{caps:s,fileReadsCompleted:0,contextBytesApprox:0}:{caps:null,fileReadsCompleted:0,contextBytesApprox:0},tokens:{input:n,output:r,sum:i,ceiling:o,perTurn:[]},cacheHitPct:t?.cacheHitRatio!=null?Math.round(t.cacheHitRatio*100):null,cacheHitPctPerTurn:[],planFile:e.planFile,turn:t?.turns??0,activities:[],tools:[],thinking:{blocks:[]},scout:{selected:null,reasoning:null},validation:[],assistantMd:"",error:null}}function kBe(e){const t=hU(e);let n="done";return!e.success&&e.partial?n="cancelled":e.success||(n="failed"),{...t,phase:n}}function OBe(e){return e.kind==="tool_call_completed"?{...e,isError:e.isError??!1}:e}function CBe({record:e,incompleteTimeline:t}){const{toast:n}=Qr();async function r(){try{await navigator.clipboard.writeText(e.runId),n({tone:"success",title:"Run ID copied"})}catch{n({tone:"warning",title:"Copy failed"})}}return g.jsxs("div",{className:"mb-6 flex flex-wrap items-start gap-4",children:[g.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[g.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g.jsx(Ee,{tone:"default",title:"Truncated planner id",children:cU(e.runId)}),t?g.jsxs(Ee,{tone:"warning",children:["Run did not complete cleanly — last seen at ",fU(e.completedAt)]}):null,e.planFile?null:g.jsx(Ee,{tone:"default",children:"No plan file written"})]}),g.jsx("div",{className:"flex flex-wrap gap-3 text-[13px]",children:g.jsxs("span",{className:"text-[var(--color-text-muted)]",children:[e.feature," / ",g.jsx("span",{className:"font-medium text-[var(--color-text)]",children:e.storyId})]})})]}),g.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.planFile?g.jsx(vt,{to:"/plans/$feature/$planFile",params:{feature:e.feature,planFile:y8(e.planFile)},className:"btn-secondary inline-flex items-center rounded-[var(--radius-md)] px-3 py-1.5 text-[13px] font-medium",children:"Open plan"}):null,g.jsxs(vt,{to:"/stories/$feature/$id",params:{feature:e.feature,id:e.storyId},className:"btn-secondary inline-flex items-center gap-2 rounded-[var(--radius-md)] px-3 py-1.5 text-[13px] font-medium",children:[g.jsx(iX,{size:14,"aria-hidden":!0}),"Open intake"]}),g.jsx(fe,{type:"button",variant:"secondary",leftIcon:g.jsx(QC,{size:14,"aria-hidden":!0}),onClick:()=>void r(),children:"Copy run ID"})]})]})}function ABe({record:e}){const t=`.squad/runs/${e.runId}.events.jsonl`;return g.jsxs("footer",{className:"mt-8 border-t border-[var(--color-border)] pt-4 text-[12px] text-[var(--color-text-muted)]",children:[g.jsxs("details",{className:"rounded-lg border border-[var(--color-border)] bg-[var(--gray-2)] p-3",children:[g.jsx("summary",{className:"cursor-pointer select-none font-medium text-[var(--color-text)]",children:"Summary record (JSON)"}),g.jsx("pre",{className:"mt-3 max-h-48 overflow-auto rounded-md bg-[var(--gray-3)] p-3 font-mono text-[11px]",spellCheck:!1,children:JSON.stringify(e,null,2)})]}),g.jsxs("p",{className:"mt-3",children:["Timeline file on disk (may be gzipped after rotation): ",g.jsx("code",{className:"font-mono text-[var(--color-text)]",children:t})]})]})}function PBe(){const e=_r(),{toast:t}=Qr(),{runId:n}=Pc({from:"/runs/$runId"}),{tab:r}=Ec({from:"/runs/$runId"}),i=C.useRef(!1),[o,s]=C.useState(null),a=C.useCallback(O=>{s(O),window.setTimeout(()=>s(null),320)},[]),l=wt({queryKey:["runs","active",n],queryFn:()=>Me("/api/runs/active")}),u=wt({queryKey:["run-detail",n],enabled:!!n,queryFn:()=>Me(`/api/runs/${encodeURIComponent(n)}`),retry:!1}),[c,f]=C.useState(null),[h,d]=C.useState(!1),[p,m]=C.useState(!1),[v,b]=C.useState(!1);if(C.useEffect(()=>{i.current=!1},[n]),C.useEffect(()=>{!n||!l.data||l.data.some(O=>O.runId===n)&&(i.current||(i.current=!0,t({tone:"info",title:"Still active run",description:"This run is still active — opened the live view instead."}),e({to:"/generate",search:{feature:"",storyId:""}})))},[n,l.data,e,t]),C.useEffect(()=>{const O=u.data;if(!O||!n||i.current)return;m(!1),b(!1),d(!0),vTe();let A=hU(O);f(A);let P=!1;return(async()=>{try{let M=0;const j=2e3;let E=!1;for(;!P;){const D=await Me(`/api/runs/${encodeURIComponent(n)}/events?from=${M}&limit=${j}`),R=Date.now();for(const N of D.events){const B=OBe(N);A=m8(A,B,R),B.kind==="done"&&(E=!0)}if(P)return;if(f(A),M+=D.events.length,D.events.length<j)break}!P&&!E&&b(!0)}catch{if(P)return;m(!0),b(!1),f(kBe(O))}finally{P||d(!1)}})(),()=>{P=!0}},[u.data,n]),!n)return g.jsx(Ce,{title:"Run",description:"Missing run identifier.",children:g.jsx(Ae,{tone:"warning",children:"No run selected."})});if(u.error instanceof kr)return g.jsx(Ce,{title:"Run report",description:"Persisted planner run.",children:g.jsx(Ae,{tone:"warning",title:"Session expired",children:"Reopen squad console from your project."})});if(u.isPending||l.isPending)return g.jsx(Ce,{title:"Run",description:"Loading…",children:g.jsx(Tn,{className:"h-36 w-full"})});if(i.current&&l.data?.some(O=>O.runId===n))return null;if(u.error&&wBe(u.error)&&!l.isPending&&!(l.data??[]).some(O=>O.runId===n))return g.jsx(Ce,{title:"Run not found",description:"This planner run id is unknown to the server.",children:g.jsx(Ae,{tone:"warning",children:"Run not found — it may have rotated out (we keep the last 20 summaries on disk)."})});if(u.error)return g.jsx(Ce,{title:"Run report",description:"",children:g.jsx(Ae,{tone:"danger",children:u.error instanceof Error?u.error.message:String(u.error)})});const y=u.data,x=c;if(!y||!x)return g.jsx(Ce,{title:"Run",description:"",children:g.jsx(Tn,{className:"h-36 w-full"})});const k=Math.max(1,Math.round(y.durationMs/1e3)),w=r==="issues"||r==="telemetry"||r==="plan"?r:"plan",S=w==="issues"&&p?"plan":w;return g.jsxs(g.Fragment,{children:[h?g.jsx("div",{className:"fixed left-0 right-0 top-0 z-[var(--z-overlay)] h-1 overflow-hidden bg-[var(--gray-4)] motion-safe:animate-pulse",role:"progressbar","aria-label":"Loading event timeline",children:g.jsx("div",{className:"h-full w-1/2 bg-[var(--color-info)]"})}):null,g.jsxs(Ce,{title:`Run ${cU(y.runId)}`,description:`${y.feature} / ${y.storyId} — ${fU(y.completedAt)}`,children:[g.jsx(CBe,{record:y,incompleteTimeline:v}),p?g.jsx(Ae,{tone:"warning",title:"Event timeline unavailable",children:"The events JSONL could not be read (missing or unreadable after rotation). Showing summary statistics only — Activity and Issues replay are disabled."}):null,g.jsx(d8,{state:x,elapsedSec:k,frozen:!0}),g.jsx(p8,{runtime:x.runtime,auth:x.auth,telemetryPartial:!1}),g.jsx(g8,{stages:x.stages,onJump:a}),g.jsx(f8,{budget:x.budget,startedAtMs:x.startedAtMs,replayWallSec:k}),g.jsxs("div",{className:"grid gap-4 lg:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]",children:[p?g.jsx(Ae,{tone:"info",children:"Activity feed requires a readable events file."}):g.jsx(c8,{rows:x.activities,jumpStage:o,replayed:!0}),g.jsx(h8,{state:x,replayed:!0,initialTab:S,hideIssuesTab:p})]}),g.jsx(ABe,{record:y})]})]})}const Qs=dK({component:LX});function Xs(e,t){return cl({getParentRoute:()=>Qs,path:e,component:t})}const EBe=Xs("/",QSe),TBe=Xs("/stories",ZSe),_Be=cl({getParentRoute:()=>Qs,path:"/stories/$feature/$id",component:qEe}),jBe=Xs("/plans",XEe),MBe=cl({getParentRoute:()=>Qs,path:"/plans/$feature/$planFile",component:YEe}),IBe=cl({getParentRoute:()=>Qs,path:"/plans/$feature/diff",validateSearch:e=>({a:typeof e.a=="string"?e.a:"",b:typeof e.b=="string"?e.b:""}),component:nTe}),NBe=cl({getParentRoute:()=>Qs,path:"/generate",validateSearch:e=>({feature:typeof e.feature=="string"?e.feature:"",storyId:typeof e.storyId=="string"?e.storyId:""}),component:_Te}),RBe=Xs("/config",aBe),DBe=Xs("/secrets",uBe),LBe=Xs("/tracker",fBe),$Be=Xs("/doctor",pBe),BBe=Xs("/runs",vBe),FBe=cl({getParentRoute:()=>Qs,path:"/runs/$runId",validateSearch:e=>{const t=typeof e.tab=="string"?e.tab:"";return{tab:t==="plan"||t==="issues"||t==="telemetry"?t:"plan"}},component:PBe}),zBe=cl({getParentRoute:()=>Qs,path:"/__design",validateSearch:e=>({design:typeof e.design=="string"?e.design:void 0}),component:mBe}),WBe=Qs.addChildren([EBe,TBe,_Be,jBe,MBe,IBe,NBe,RBe,DBe,LBe,BBe,FBe,$Be,zBe]),UBe=CK({routeTree:WBe});function HBe(){return g.jsx("div",{className:"flex min-h-screen flex-col bg-[var(--color-bg)] px-6 py-12 text-[var(--color-text)]",children:g.jsx(Ce,{title:"Session not available",description:"The console must be opened with a fresh link from the CLI.",children:g.jsxs(Ae,{tone:"warning",title:"Session expired",children:[g.jsxs("p",{children:["The console URL must include a fresh token from the terminal. Run ",g.jsx(Wi,{children:"squad console"})," again and open the link it prints (or paste ",g.jsx(Wi,{children:"?t=…"})," into the address bar)."]}),g.jsxs("p",{className:"mt-2 text-[var(--color-text-dim)]",children:["If you closed the terminal, start ",g.jsx(Wi,{children:"squad console"})," from your project root."]})]})})})}const VBe=new fV({defaultOptions:{queries:{staleTime:5e3,retry:1,refetchOnWindowFocus:!1}}}),BO=document.getElementById("root");if(!BO)throw new Error("missing #root");const qBe=TK();qBe?_w(BO).render(g.jsx(C.StrictMode,{children:g.jsx(hV,{client:VBe,children:g.jsx(OX,{children:g.jsxs(bX,{children:[g.jsx(EK,{router:UBe}),g.jsx(pX,{}),g.jsx(wX,{})]})})})})):_w(BO).render(g.jsx(C.StrictMode,{children:g.jsx(HBe,{})}));
|